Skip to content

MobileCRM.DynamicEntity.deleteAsync

maros316 edited this page Feb 17, 2020 · 9 revisions

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