Options

service.Delete(cust.Key) method in Webservice.

SivaMohanYerramsettySivaMohanYerramsetty Member Posts: 26
edited 2009-10-17 in NAV Three Tier
Hi everyone,
could please tell me, what exactly delete() function will do in Code 1 and code 2.
cust = service.Read(cust.No);
service.Delete(cust.Key);
and
cust = wService.Read(cust.No);
 Console.WriteLine(cust.No + " Name:" + cust.Name);
 Console.ReadLine();
wService.Delete(cust.Key);
:?:
Shiv

Comments

  • Options
    AdrianAkersAdrianAkers Member Posts: 137
    Hi,

    You need to provide a little more detail on the declaration of your variables...

    If I was doing something like this I would expect to see... (albeit you need to implement some "try catch" as well as I have not shown all variable declarations...)
    public bool DeleteCustomer(string pCustomerNo)
    {
       Customer_Service cs = new Customer_Service();
    
       cs.UseDefaultCredentials = true;
       cs.Url = CustomerServiceReference;
       cs.PreAuthenticate = true;
    
       Customer cust = ws.Read(pCustomerNo);
       cs.Delete(cust.Key);
    
       return true;
    }
    
Sign In or Register to comment.