Skip to content

MobileCRM.DynamicEntity.loadAsync

rescocrm edited this page May 15, 2023 · 9 revisions

Asynchronously loads the CRM entity properties.

Arguments

Argument Type Description
entityName String The logical name of the entity, e.g. "account".
id String GUID of the existing entity or null for new one.

This example demonstrates how to load the account entity with given id.

// WARNING: async/await pattern requires ECMAScript 6 and it's not supported on Internet Explorer.
// It's supported by all modern browsers including mobile version of Chrome and Safari (requires Android 5+ and iOS 10+).
function getAccountData(accountId) {
	return __awaiter(this, void 0, void 0, function* () {
		try {
			var entity = yield MobileCRM.DynamicEntity.loadAsync("account", accountId);
			MobileCRM.bridge.alert(JSON.stringify(entity));
		}
		catch (err) {
			MobileCRM.bridge.alert(err);
		}
	});
}
Clone this wiki locally