Is there any way to make it sync

Nov 20, 2013 at 5:59 AM
Is there any way to make it sync
Coordinator
Nov 20, 2013 at 8:08 AM
Hi sukants,

every method supports the options parameter "opt_asyn" that per default is set to "true". So to perform sync operation just pass "false" as last parameter when invoking the method:
var fetchxml = ['<fetch version="1.0" output-format="xml-platform" mapping="logical">',
                '  <entity name="account">',
                '    <attribute name="name" />',
                '    <attribute name="accountid" />',
                '    <attribute name="createdon" />',
                '    <attribute name="createdby" />',
                '    <filter type="and">',
                '      <condition attribute="name" operator="eq" value="foobar" />',
                '    </filter>',
                '  </entity>',
                '</fetch>'].join('');

// perfrom sync operation
CrmFetchKit.Fetch(fetchxml, false).then(function (results) { 

    // ...
});
The only exception is the "FetchAll" method, which could only be executed in sync-mode.

Hope this helps,

Daniel
Marked as answer by thuld on 11/20/2013 at 4:17 AM