Hi All,
I am gettng following error when I try to modify record using MS dynamics nav webservices.
Element “Key” in namespace “urn:microsoft-dynamics-schemas/page/ws_customer” is missing from the message!
My code is like,
WS_Customer_Service
custService = new WS_Customer_Service();
custService.UseDefaultCredentials =
true;
custService.Credentials =
new System.Net.NetworkCredential(“username”, “pw”);
WS_Customer Cust = new WS_Customer();
//Create Customers---------------------
try
{
Cust.No = txtNo.Text;
Cust.Name = txtName.Text;
Cust.Name_2 = txtName2.Text;
Cust.Address = txtAddress.Text;
Cust.Address_2 = txtAddress2.Text;
Cust.City = comboBox1.Text;
Cust.Country_Region_Code = comboCountry.Text;
Cust.Phone_No = txtPhoneNo.Text;
Cust.E_Mail = txtEmail.Text;
Cust.Gen_Bus_Posting_Group = comboGenBus.Text;
Cust.VAT_Bus_Posting_Group = comboVatBusPosGr.Text;
Cust.Customer_Posting_Group = comboCusBusPosGr.Text;
custService.Update(
ref Cust);
custService.Create(
ref Cust);
}
catch (Exceptionex){
MessageBox.Show(ex.Message);
//custService.Update(ref Cust);
WS_Customer Cust2 = new WS_Customer();
custService.Update(
ref Cust2);
}
CAN ANY ONE TELL ME HOW TO SOLVE THIS?