Hi All,
Since CRM 2016 we got this new WEBAPI that will replace the SOAP endpoint.
The community already spent a lot of effort creating helper files to make our life easier.
Being a C# and not a JScript developer, I'm a bit stuck on one part of the concept.
I do understand the importance of async handling of these odata calls.
But I can't get my head around a simple function I need to create.
I have one function CanApprove that will have to return false or true depending on some criteria (which is not important for this question).
This is will manage the visibility of the button via an EnableRule of the Ribbon Workbench.
How do I make the function 'wait' until the odata call returns , and only then return the value 'true' or 'false'.
I could define a global boolean 'CallFinished' + result variable and make the CanApprove wait with a while CallFinished = false.
In the success or error function of the odata call, I would then set the result / CallFinished variable.
But I hope there are other and cleaner solutions to achieve my goal.
Since synchronious xdr and XMLHttpRequest is depreciated, I better not resort to that solution either.
Very curious how this is tackeld in the field ...
Regards,
Sven Peeters