-
Notifications
You must be signed in to change notification settings - Fork 24
MobileCRM.UI.EntityList.onCommand
rescocrm edited this page May 15, 2023
·
9 revisions
Binds or unbinds the handler for EntityList command.
Bound handler is called with the EntityList object as an argument. The EntityList context object contains the "cmdParam" property and "entities" property with the list of currently selected entities.
| Argument | Type | Description |
|---|---|---|
| command | String | The name of the EntityList command. |
| handler | function(entityList) | The handler function that has to be bound or unbound. |
| bind | Boolean | Determines whether to bind or unbind the handler. |
| scope | Object | The scope for handler calls. |
This example demonstrates how to display the parent account form by pressing the custom contact list button 'OpenAccount'. The custom command can be added on the view via Woodford/Resco CRM.
MobileCRM.UI.EntityList.onCommand("custom_OpenAccount", function (entityList) {
/// <param name='entityList' type='MobileCRM.UI.EntityList'>
var selectedEntities = entityList.context.entities;
if (selectedEntities.length === 1) {
var customer = selectedEntities[0];
MobileCRM.UI.FormManager.showDetailDialog(customer.entityName, customer.id);
}
}, true, null);