Hello everybody,
this is my first post and I'm new in Navision.
I'm consuming a webservice from Dynamics NAV 2009 R2 as in this very helpful blog
http://blogs.msdn.com/b/freddyk/archive/2010/01/19/connecting-to-nav-web-services-from-php.aspx. Everything works fine, but the result does not contain blank fields. So I have in the result an array with stdObj. Each stdObj is a dataset from Navision but it contains just the fields which have set a value, the blank fields aren't in the data set.
Does anybody know how to get the blank fields in the result too?
Thank you a lot, Marius
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
There are some problems there, e.g. I have to find a workaround for sorting the datasets, while each data set contains different fields. For the date fields I have '01.01.0001' even if they are blank, for other fields as number or string fields I have nothing, because they aren't published at all. Further i have some issues because of that in my presentation framework ExtJS. I have to hijack the result in php, but so it is everything slowlier.
It will be better if Navision would have the sense to publish the blank fields through the webservice too as in the case of date fields. Do you know if it is possible to configure it in Navision?
Thank you for your time
E.g. date filter - there is problem which I understand - the field is of type DateTime but is empty if the date in NAV is empty - thus it is creating problems e.g. in C# code trying to parse the empty value to date... but in this case, if the PAGE in NAV is specially created for the webservice, there could be process, which all empty dates replace with some predefined value...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I have more webservices and I would like to use the same php script for all oh them. As I mentioned, I cannot sort and do paging on the result as it is. Since I have an array with stdObj and each stdObj contain different fields I have to merge to each stdObj the missed blank fields in order to sort and paging it. Or when I update a field in ExtJS-Page and send back to NAV and that field has dependecies in NAV and other fields of the same dataset will get programatically empty, they will be not in the response so I'll have different values in NAV-Page and ExtJS-Page since they don't get synchronized. My workaround is working but is much slowlier.
So, there is nothing to do to get in the response(ReadMultiple, Update) the blank fields?
I very appreciate your help, thank you.
Mainly I do not understand this: How the object could contain different fields? All objects returned by readmultiple have same structure, same "properties". How you can have in one array objects with different fields? Are you reading the objects into this array by different webservices?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
As you see, each object has different properties.
And my workaround for merging the missed properties, since they are empty and not published by the NAV-Page is:
Now I can do sorting and paging on the datasets.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Yes, the array is returned by the webservice.
The XML returned from the webservice is:
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I really appreciate all your support, you are very helpful, thank you.