Command editor
App users can execute commands from their app, for example, run a mobile report or delete several records at once. Some commands are available automatically, for example, Save command when editing a form. Woodford administrators can add more commands to the app projects, modify command availability and behavior, or even create new commands from scratch.
In the app, commands are available in the top right corner of a form. If your form only has one or two commands, they are displayed directly; if you have more commands, users can select the from the Hamburger menu.
Managing commands
Commands can be customized in several Resco tools:
- In Woodford, you can edit the commands available for a form.
- In Woodford, you can edit the commands available for a view as row buttons, or when you select multiple records.
- In Questionnaire Designer, you can edit the commands available when filling out a questionnaire.
In all cases, the behavior of the editor is very similar.
- Do one of the following to open the command configuration window:
- In form designer, click Commands.
- In view designer, click Buttons or Multi Select.
- In Questionnaire Designer, click Edit.
- To add commands, move them from the Available Commands pane to the Selected Commands pane. Some commands can be added multiple times.
- Some commands can be configured. Select the command in the Selected Commands pane and click Properties.
- To create a new custom command, click New Command. Provide a name and a label, then click OK.
- Click Save & Close.
Command rules
Predefined commands usually function out of the box. However, you can use rules to define their availability and tweak their function. Custom commands do nothing unless you use rules to define associated actions. Rules are modified in Rules editor; the following apply to commands:
- On Can Execute defines when is a command available in the app.
- On Execute defines what happens when the command is executed.
- Other form rules: use the ExecuteCommand operation to start a command from rules.
Command rules are partially available in views:
- Button Click defines what happens when a view button is tapped.
- Custom multiselection commands cannot be defined using rules; you must use JavaScript.
Available commands
Different commands are available on each location.
Form commands
- ChangeState – Change state code of a record. You can also specify which state options are available to users. Each state option is displayed as a separate command.
- ChangeStatus – Change status code of a record. You can also specify which status options are available to users. Each state option is displayed as a separate command.
- Delete – Delete the record from the database. If performed in offline mode, after synchronization the record is also deleted from the CRM server.
- EmailLink – Create an email with links to the record, for CRM server and for Mobile CRM application.
- Favorite – Add or remove the records from Favorites. You also need to add Favorites to Home to give users a way to access favorite records.
- PrintReport – Runs an SSRS report. Applies to Dynamics only. For more information read How to run an SSRS report via the Resco Mobile CRM app. Blog
- RunMobileReport – Generate a mobile report for the record.
- Scan – Only on the new records belonging to Contact and Lead entity – Starts barcode scanner and by scanning VCard/Me Card enabled QR code on a business card (or elsewhere) it will fill in appropriate fields of a new record.
- ScanBusinessCard – Only on a Contact and Lead entity – Similar to the previous command, but runs CamCard application to scan a business card, and by using text recognition, it fills in the appropriate fields. The user needs to have the CamCard application installed on the device and needs to enter CamCard Api Key to Project’s Configuration (section Advanced).
- Qualify – Allows record qualifying. Available on Lead and Activity entities.
- GetProducts – Loads products to Invoice or Order from the selected associated record (e.g. opportunity).
- WonOpportunity – Sets opportunity as won and closes it.
- LostOpportunity – Sets opportunity as lost and closes it.
- CreateInvoice – Creates an invoice from the order.
- CheckIn – Indicates when an activity starts. See Check in/check out.
- eSignature – Available for PDF attachments, the eSignature command allows you to sign documents using DocuSign.
- RemoteAssistance – Initiate a video call with augmented-reality support using Houston.
Address commands
The following commands are available automatically if the form meets certain prerequisites; you don't have to enable them. The form must include a detail tab called "Address" or "Ship" and/or the fields "Latitude" and "Longitude".
- NavigateTo – Starts the device's default map navigation.
- UpdateGPS – Sets the current device’s position to record’s latitude and longitude fields using Google Maps Services. (The configuration settings GPS Position Accuracy and GPS Position Age apply to this command and the next one.)
- UpdateAddress – Sets the current device position (latitude, longitude fields) and address (Street, City, Country) by using Google Maps Services.
View commands
The following commands are available as row buttons and multi-selection commands:
- ChangeState – Change state code of a record. You can also specify which state options are available to users. Each state option is displayed as a separate command.
- ChangeStatus – Change status code of a record. You can also specify which status options are available to users. Each state option is displayed as a separate command.
- Delete – Delete the record from the database. If performed in offline mode, after synchronization the record is also deleted from the CRM server.
- EmailLink – Create an email with links to the record, for CRM server and for Mobile CRM application.
- Favorite – Add or remove the records from Favorites. You also need to add Favorites to Home to give users a way to access favorite records.
- Assign – Change the ownership of the items.
- AssignToMe – Change the ownership of the items.
- MarketingList
- RunMobileReport – Generate a mobile report.
- Export – Save selected records to a file. You can select the fields you need and the destination format (PDF, HTML, CSV, Word document, or Excel document).
- Import – Allows importing of records from delimited text files. Comma, semicolon, tab, or pipe can be used as a delimiter.
- Merge – Combine two or more records into a single one. You can select one master record and the status for subordinate records (often inactive). You can select which fields to keep. You can also choose if records with reference to the subordinate record(s) should change the reference (reparent) to the master record (recommended).
- Bulk update – Update multiple records at once.
The following additional commands are available as row buttons.
- SMS
- Open
- Create
- Call – Requires that a phone number is included in the view.
- Email – Requires that an email address is included in the view.
Additional commands for attachment entities, such as Annotation/Note:
- OpenAttachment – Open the attachment in an external viewer.
- Download – Download missing binary content of notes, usually in case it is not synced to the device due to filtering or sync was interrupted.
- EmailAttachment – Create an email message with the selected attachments. (Note: On the Microsoft Store edition of Resco mobile apps, sending attachments is only possible using the Windows default email client, the Mail app.)
Questionnaire commands
- Save and close
- Save, close, and open new
- Complete and close
- Complete, close, and open new
- Complete with a report
- Run mobile report
- Cancel the questionnaire
- Clear answers
- View mobile report
See Questionnaire Designer for more information.
Business card scanning
CamCard integration with Mobile CRM app works in such a way, that when creating a new Lead or a Contact, you can select a command (in Mobile CRM app) that starts the CamCard app and you can scan the card. Then it transfers the information back to the Mobile CRM app’s new Lead or Contact record.
You need to do the following:
- Enable the command (ScanBusinessCard) on Lead or Contact entity edit form.
- Install the CamCard app (free version) on your device (with iPad, you need to install the CamCard app from iPhone, not the HD version).
- Obtain an Open API key for iOS from Intsig (the company that develops the CamCard app) and enter it into the app project’s Configuration CamCard ApiKey field. This key is used for both iOS and Android platforms.
- During the first use, you need to follow the registration process in the CamCard app until you can scan the card.
- Scan the card and return to the Resco Mobile CRM app.
Note | Intsig has special pricing for Resco customers; you need to specify that you are a Resco customer when contacting them. If you are not already in contact with Intsig, you can let us know, and we can give them contact to Intsig. |
Note | Due to the operating system's security limitations in Android 12 and newer, it's not possible to automatically save the business card photo taken by the CamCard app to an annotation field. To save the photo, take a separate picture, either from the Mobile CRM app or attach it from your device's gallery. |
Resco Mobile CRM app can update the following fields by using the scanned card information from CamCard:
LastName | Tel (Work/Home/Fax/Cell) |
FirstName | Email (Work/Home) |
MiddleName | Address |
Prefix | GEO |
Suffix | Url |
Title | NickName |
Org | Bday |
Check in / check out
The check in and check out commands can be used to indicate when an activity starts and ends. For example, technicians may want to document when they start working on a task and when they finish. This functionality is available from the 11.2 version of the application. It can be configured for any entity available in Woodford; however, if your entity does not include date fields, the commands don't make sense.
- In an app project, edit a form of an entity. For example, use the Appointment entity.
- Click Commands and add CheckIn to the Selected Commands pane.
- Select CheckIn and click Properties to open the configuration.
- Configure which entity fields should be filled when users tap the Check In and Check Out commands:
- Check In time and Check Out time: These generally correspond to Start Time and End Time. These two fields are mandatory. Note that these fields become read-only so that users cannot manually modify the time set by the commands.
- Duration, Latitude, Longitude: Optionally, select additional entity fields. Geographical coordinates must be Float type, and the duration can be Float or Decimal number.
- Status: Allows you to change the status of a record when you check in or out. If the status field is chosen, you also need to configure the fields Change Status after Check In and Check Status after Check Out. If you select more options, users must choose one of them.
- If you want to make the commands available only for records with a certain status, use the parameters Check In possible for Status and Check Out possible for Status.
- Click OK to close the Check In Config window, then Save & Close.
Custom commands
You can also create custom commands where you define:
- when is a command available
- what does it do.
Click New Command and enter a name and a label for the command.
You have two options for making the command actually do something:
- Use the form rules On Execute and On Can Execute for managing command behavior. (Not available for views.}
- It is also possible to connect custom commands with offline HTML with JavaScript and perform actions that are not available when using command rules. See the MobileCRM.UI.EntityList.onCommand function for more information.
Note | For entity forms and questionnaire forms, if the custom command action is not found in the On Execute rule, the app will try to find the behavior in the iframe attached to the form (if any). If neither defines the action for a command, the command might not be displayed in the app. |
Form rule examples
On Can Execute rule defines when the command is available for the user. In this rule, you specify in what situation users can see and use the command, so that you can hide this command in situation, when its action is not suitable.
If Condition | Command.Name | Equals | custom_del_street | |
Then | If Condition | Entity.addres1_line1 | ContainsData | |
Then Step | Command.isEnabled | Assign | True | |
Else Then Step | Command.isEnabled | Assign | False |
On Execute rule defines the actions that the command performs. It can be filling in some data, hiding fields, etc.
If Condition | Command.Name | Equals | custom_del_street |
Then Step | Entity.addres1_line1 | Clear |
Disable Update GPS command
A simple example is the Update GPS command on the Edit form’s Address tab. Users should not change the GPS position of a record, that already has the GPS position set so you can hide this command in such a situation.
If Condition | Command.Name | Equals | UpdateGPS | |
Then | If Condition | Entity.address1_latitude | ContainsData | |
and Condition | Entity.address1_longitude | ContainsData | ||
Then Step | Command.isEnabled | Assign | False | |
Else Then Step | Command.isEnabled | Assign | True |
Disable Delete command
Another example is when you want to prevent users from deleting a record. You can disable deleting records by not putting the Delete command on Selected commands section. But what if you want them to delete commands in some situation? You can add the Delete command but hide it in specific situations. In this case, we will not allow users to delete records that are owned by different users.
If Condition | Command.Name | Equals | Delete | |
Then | If Condition | Entity.ownerid | Does Not Equal Current User | |
Then Step | Command.isEnabled | Assign | False | |
Else Then Step | Command.isEnabled | Assign | True |
Disable signature on Note attachment
Yet another example can be when you don’t want to have Signature on Note’s Attachment. To disable it, you need to go to Note’s Form and adjust the On Can Execute rule.
If Condition | Command.Name | Equals | DocAction.CaptureInk |
Then Step | Command.isEnabled | Assign | False |
The tricky part can be setting the command’s name. It needs to be exactly DocAction.CaptureInk (Beware, it’s case sensitive!).
All DocActions
Here is the list of all DocActions, all possibilities you can do with Note attachment’s commands:
- Actions for an empty attachment
- DocAction.CaptureInk – Configures the view for Capturing Signature. When disabled, list of available commands is shown
- DocAction.CapturePhoto – Asks user to capture a photo and loads the chosen media into the view
- DocAction.SelectPhoto – Asks user to choose a media (image, video, depending on what the platform supports) and loads the chosen media into the view
- DocAction.SelectFile – Asks user to choose a file and loads it into the view
- DocAction.RecordAudio – Asks user to record an audio note and loads it into the view
- DocAction.RecordVideo – Asks user to record a video and loads it into the view
- DocAction.UseLastPhotoTaken – When user captures photo using the camera, and then wants to attach this picture to a Note, this action can be used, instead of Select Picture and navigating to the picture.
- DocAction.LoadFrom – Asks the user to choose file from either online or offline location and loads it into the view.
- Actions for non-empty attachment, i.e., when there is a file attached to a Note
- DocAction.Clear – Clears the view and marks it as empty
- DocAction.View – Shows a preview of the loaded document (full screen, etc.)
- DocAction.OpenExternal – Opens the loaded document in an external application. Which application will be used, is platform-specific
- DocAction.FindApp – Find an external application for opening specific documents. The find method is platform-specific (i.e., find on Android Market)
- DocAction.Download – Saves file in device, platform-specific
- DocAction.Copy – Copies the note record
- DocAction.Paste – Pastes the note record (these actions don't go through regular device clipboard; they only allow copying within the app, from one record to another)
- DocAction.Print – Prints the document
- DocAction.ResizeImage – Lets the user choose a smaller image resolution
- DocAction.Import – Lets user import VCard attachment (handled in common code)
- DocAction.Edit – Allows the document to be edited directly in the Resco Mobile CRM application
- DocAction.SendTo – Creates a new Email with the file/document as an attachment (Android only)
- DocAction.Export – Save attachment as a file to the device’s file system
- DocAction.Email – Send documents as attachments.
- The visibility of the Email command in the app also depends on the app Setup parameter Send Emails via. If you are using "CRM server" for sending mail, the user must have the right to create a new record of the email and attachment (activitymimeattachment) entities.
See also FS Mobile: Remove Signature from Notes. Blog
On Execute example
Can Execute rule can define what exactly should a command do. For example, it can fill in some specific fields and set the status code as busy.
If Condition | Command.Name | Equals | Data | |
Then | If Condition | Entity.description | Does Not ContainData | |
Then Variable | Date_Time current | SetToday | ||
Step | Entity.description | Assign | current | |
Step | Entity.statuscode | Assign | Busy | |
Else Then Step | Entity.statuscode | Assign | Busy |
Different uses for Update Address command
The Update Address form command becomes available on a form automatically if the entity contains address fields. The command has two functions:
- Update address fields (GPS coordinates as well as street address) using your current position (default function)
- Update address using existing record data (i.e., use GPS coordinates to determine street address)
The default option is to update the address using your current position. You can use an On Execute rule to change this behavior.
Param value | Behavior |
---|---|
0 (default) | Update using current position |
1 | Update using existing record data |
2 | User can select the desired behavior |
Tip | Some of the commands, just like "UpdateAddress" contain defined parameters. Parameters are the specified command configuration. They can modify what the command does. Use "Command.Param" to pass the parameter to the command function. Other commands that allow parameters include ChangeStatus and RunMobileReport. Custom commands can also use parameters. |
Renaming commands
Commands can be renamed using Localization. See Localization examples for inspiration.
Command icons
You can modify the icons for the default commands, and you can add icons for your custom commands. However, the icons are only displayed if you have less than 3 commands per form; otherwise, the command labels are displayed and available in the hamburger menu.
- Create a custom command. Remember the name.
- Go to Images, click Add, and upload an image with the appropriate name to the
Cmd
directory. - Save all changes and publish the project.
To modify the icon of built-in commands, go to Images, change to the Cmd
directory, select the image you want to change and upload a replacement icon.
Report commands
Mobile reports can also have commands that allow users to work with the reports.
However, the traditional way of managing commands using the command editor, On Can Execute, and On Execute rules is not available for mobile reports. Use Advanced report config instead.