29.01.2015, 15:13 | #1 |
Участник
|
I stand corrected. A month ago I wrote about how to pass JSON from JavaScript to C/AL and then handle it inside, and what I wrote is not wrong, but I just figured a simpler way.
Too bad all this is not documented, but hey – that’s why blogging is fun. In my last blog post, I wrote that the steps are these:
First, instead of declaring the delegate as this: public delegate void ObjectEventHandler(object data);… declare it as this: public delegate void ObjectEventHandler(Person data);Then, step 4 is completely unnecessary. When you pass a JSON to C/AL, NAV runtime will attempt to deserialize it into the object type you expect as a parameter. Here, if you expect a Person parameter, and you pass JSON that can be deserialized into an instance of the Person class, NAV runtime will do the deserialization for you, and you get the data as expected. How does it work? I don’t know for a fact, because this is undocumented, and I only could figure it out by trial and error, but this is what I believe is going on:
Read this post at its original location at http://vjeko.com/blog/passing-json-javascript-calpart-2, or visit the original blog at http://vjeko.com. 5e33c5f6cb90c441bd1f23d5b9eeca34The post Passing JSON from JavaScript to C/AL–Part 2 appeared first on Vjeko.com. </img> </img> Читать дальше
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|