Hi this is Michael, I am developing one web application using Nav Web services, while updating the records through web service its throwing error like, the given key is not well formed, How can i get the correct key value of the specified record. Please do the needfull!!!!!!!!!!
0
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
This is the c# code:
Customer_Service custservice = new Customer_Service();
custservice.UseDefaultCredentials = true;
Customer Bolt = custservice.Read("9999999998");
custservice.DeleteCustomer(Bolt.No); // this function was made by me in codeunit
This is the codeunit code:
DeleteCustomer(CustomerID : Record Customer)
Cust.GET(CustomerID);
Cust.DELETE;
I get an error "Key '9999999998' is not well formed" in the c# program. Any ideas of why this happens?
|To-Increase|
But in the c# code. What do I pass in for the record parameter in the Nav fuction?
The reason for this test project is to try how to extend page web service with custom codeunit functions.
For me to do that I have to have same record on the first parameter in the codeunit as for the page source and name it the same as published page in form 810 "Web service". I dont neccessary want to use this first parameter but to extend the page I have to.
So how can I use this record parameter in c# code?
Hope you understand what im trying to do.
I have to use Customer.Key in the parameter.
This is the correct c# code:
Customer_Service custservice = new Customer_Service();
custservice.UseDefaultCredentials = true;
Customer Bolt = custservice.Read("9999999998");
custservice.DeleteCustomer(Bolt.Key); // this function was made by me in codeunit
Thanks Sog for your help. :thumbsup:
I am facing similar issue "Key is not well formed" while updating Item record using web-services.
Please help me in resolving it.
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal