You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rescocrm edited this page Aug 2, 2024
·
10 revisions
Performs the asynchronous CRM Fetch request.
Arguments
Argument
Type
Description
output
String
A string defining the output format: Array, JSON, XML or DynamicEntities.
online
Boolean
Optional parameter determining whether the fetch should be executed online or offline. If omitted, function respects current online/offline mode of the app.
This example demonstrates how to fetch a list of accounts and process their names.
varentity=newMobileCRM.FetchXml.Entity("account");entity.addAttribute("accountid");entity.addAttribute("name");varfetch=newMobileCRM.FetchXml.Fetch(entity);fetch.executeAsync(null)// "null" stands for default "DynamicEntities" result format.then(function(result){// Promise was fulfilled and we obtained an array of DynamicEntitiesfor(variinresult){varaccount=result[i];// Pass account id and name for further processingprocessAccount(account.id,account.primaryName);}}).catch(function(err){// Promise was rejected with errorMobileCRM.bridge.alert("Error fetching accounts: "+err);});