Skip to content

MobileCRM.DynamicEntity.deleteAsync

rescocrm edited this page May 15, 2023 · 9 revisions

Asynchronously deletes the CRM entity.

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 delete an account 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 deleteAccount(accountId) {
	return __awaiter(this, void 0, void 0, function* () {
		try {
			yield MobileCRM.DynamicEntity.deleteAsync("account", accountid);
			onAccountDeleted(accountid);
		}
		catch (error) {
			MobileCRM.bridge.alert("An error occurred: " + error);
		}
	});
}
Clone this wiki locally