Hi,
I am programming a C# application which uses Webservices to perform som Nav logics remotely.
I have a problem when I want to create e.g. new jobs in Nav from the client if the object contains option-fields (e.g. status). The webservice wants an instance of the option-field. But how can I create such an instance??
At the moment I write to a codeunit via webservice, an asks the codeunit to validate an integer into the option-field. It works, but it is an annoying workaround.
Anyone got a hint on how to solve this problem smoothly.!?
Thanks in advance.
/MQ
0
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The syntax is a little different from what I am using. Just to make it clear.. What is MyVendor and WebServiceApp in your code example?
/MHQ
It's the name of the I gave to the web service reference when I selected the Vendor Page from published Nav services.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Now I get it... I was doing it the right way... I did not know that the options were trigged with the dot.
e.g. ".Ship". I thought it was something like Blocked(Ship).
Thanks a lot.!
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Please who can tell me how can I fill out a dropdown list in C# with the values of an option field.
I'm using web services.
Thanks
Try with this method.
Hope this help.
Best Regards,
Yukon
i found this thread is very useful. 2 questions though:
1. do we need to translate the "_" to its relevant caption in the option field ("G_L_Account" => "G/L Account", "_blank_" => " ")? or is there any way to retrieve the actual caption string in the option field?
2. say user using the combo box and choose a value (e.g.: "G_L_Account"), what value I must use to create / update the records using webservice?
Regards,
Philipus
Specially, we no need to change it. But i changed the option caption because of i want to show like "NAV" option style.
We can't directly get caption from WS. Other way you can be use other method.
You can get value from value from your combo follow this way.
Regards,
Yukon