Anupam
Anupam

Reputation: 1841

Fetch Metadata in CRM 2011 using javascript synchronously

Is there any way to fetch metadata from CRM 2011 using javascript in a synchronous manner? If it is, could someone please hit me up with some sample code present in the SDK (I couldn't find it) or maybe your own code?

Thanks.

Upvotes: 3

Views: 1781

Answers (1)

John Hoven
John Hoven

Reputation: 4085

In the SDK, in the samplecode\js\soapforjscript\soapforjscript\scripts\sdk.metadata.js file there are RetrieveAllEntitiesAsync, RetrieveEntityAsync, and RetrieveAttributeAsync examples. To make synchronous, change the third parameter of the req.open statements to false. Then you can remove the onreadystatechange handler and handle the response immediately after the req.send(request); statement.

Upvotes: 5

Related Questions