...
This API function utilizes the same window.postMessage()
mechanism as all the rest of the Xrm API functions.
In case of Dynamics WebAPI callsAccording to Microsoft’s documentation, when executing requests, metadata retrieval happens by adding a getMetadata()
function to the prototype of the request function. The parameters (data
and metaData
) are
Request data is serialized to JSON and then sent to a sub-page for processing, using window.postMessage()
. Since functions like getMetadata
couldn’t ()
couldn't be serialized, data
and metaData
objects have to be passed separately, and the . The final query object with getMetadata()
function is assembled within the sub-page which is handling the request and responseexecution.
Example code to execute a WhoAmIRequest in a custom plugin:
...