Loop through selected records in a Multi-Select view custom command with Resco Mobile CRM

You cannot create a form rule for your custom Multi-Select command which means that you will need to add some Offline HTML to execute your custom rule. To apply your custom rule you will need to add a new command to your view. In this case I have given it the name ‘custom_Test’.

*Note* You wont see the custom command unless you have attached an iFrame calling the custom command name.


Then you will need to link you Offline HTML to your view using the iFrame button.


You then call the custom command by using the function MobileCRM.UI.EntityList.onCommand(“custom_Test“, function (entityList)

Below is the complete code for looping through the selected view records:


The ‘selectedEntities‘ variable above holds the list of selected records. To update each record you will need to execute a for loop and retrieve the id of each selected record using ‘selectedEntities[i].id‘. Once you have the id of each record you will need to update them.

In this example I am updating the ‘fs_workorder‘ entity in my own function called ‘updateWO()‘ where I’m passing the id of each record and updating a field called ‘email_sent‘ to yes.

You can use this sample code and apply it to your own needs.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.