im not able to update delete create new customer in webpro

Pinakin_PatelPinakin_Patel Member Posts: 3
edited 2009-10-02 in NAV Three Tier
hello every one,

please help me as soon as possible, i create on web application with webservice of NAV 2009, i fatch data of cutomer card successfully but i dont able to update customer data and create new customer.. ](*,)

i write code for fatch data of cutomer card are as under and it is work perfactly..but what about update and create new customer..

protected void Page_Load(object sender, EventArgs e)
{
Customer_Service Service = new Customer_Service();
Service.UseDefaultCredentials = true;
Customer[] Customers = Service.ReadMultiple(null, null, 0);
for (int i = 0; i < Customers.Length; i++)
//ListBox1.Items.Add(Customers.No);
DropDownList1.Items.Add(Customers.No);
}
protected void Button2_Click(object sender, EventArgs e)
{
Customer_Service service = new Customer_Service();
service.UseDefaultCredentials = true;
TextBox1.Text = service.Read(DropDownList1.SelectedItem.Value).Name;
TextBox2.Text = service.Read(DropDownList1.SelectedItem.Value).Address;
TextBox3.Text = service.Read(DropDownList1.SelectedItem.Value).Phone_No;
TextBox4.Text = service.Read(DropDownList1.SelectedItem.Value).City;
}

Now please give me solution as soon as possible... ]

Comments

  • kinekine Member Posts: 12,562
    Search existing examples how to use the webservices. It will be faster than waiting for answers there. You already should solve this yourself. If you have some specific problem, that something is not working etc. than it is much easier to answer it.

    Just open this URL and read the documentation... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Pinakin_PatelPinakin_Patel Member Posts: 3
    Thank you very much sir,, thanks a lot for this link... with this link i m complited find customer, update customer, delete customer and create new customer....from my webpage with using of webservices....

    :D Thanks again


    Regards
    Pinakin Patel
  • kinekine Member Posts: 12,562
    You are welcome!

    In most cases, the answers are already there... somewhere... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Ashish_GuptaAshish_Gupta Member Posts: 56
    I think this code will help u .
    First You Have to publish Web service in Navision Webservice table and then use this web service in your web application.
    For create
    StreamList_Service stream = new StreamList_Service();
            stream.UseDefaultCredentials = true;
    
            StreamList newstream = new StreamList();
            newstream.Code = txt_code.Text;
            newstream.Description = Txt_Description.Text;
            newstream.Description_2 = Txt_Description2.Text;
            
            stream.Create(ref newstream);
    

    For Update
    StreamList_Service stream = new StreamList_Service();
            stream.UseDefaultCredentials = true;
    
            StreamList newstream = new StreamList();
            newstream.Code = txt_code.Text;
            newstream = stream.Read(newstream.Code);
            newstream.Description = Txt_Description.Text;
            newstream.Description_2 = Txt_Description2.Text;
            stream.Update(ref newstream);
    
    Ashish Gupta
    Navision Technical Consultant
Sign In or Register to comment.