-
Notifications
You must be signed in to change notification settings - Fork 26
MobileCRM.MetaEntity.loadByName
rescocrm edited this page May 15, 2023
·
9 revisions
Gets the MetaEntity by its name.
If you only need to know the attributes of a single entity, use this method to prevent requesting all Metadata information.
Argument | Type | Description |
---|---|---|
name | String | A logical name of requested entity. |
callback | function | The callback function that is called asynchronously with MetaEntity object as argument. |
errorCallback | function(errorMsg) | The errorCallback which is called in case of error. |
scope | Object | The scope for callbacks. |
This example demonstrates how to get the MobileCRM.MetaEntity object.
MobileCRM.Metadata.requestObject(function (metaData) {
// Request MetaEntity object by its name.
MobileCRM.MetaEntity.loadByName("account", function (metaEntity) {
/// <param name="metaEntity" type="MobileCRM.MetaEntity"/>;
var metaProperties = "MetaEntity properties \n";
metaProperties += "can account append to contact : " + metaEntity.canAppendTo("contact") + "\n";
metaProperties += "account C-R-W-D : " + metaEntity.canCreate();
+"-" + metaEntity.canRead();
+"-" + metaEntity.canWrite();
+"-" + metaEntity.canDelete();
MobileCRM.bridge.alert(metaProperties);
}, MobileCRM.bridge.alert, null);
}, MobileCRM.bridge.alert);