Command editor

From Resco's Wiki
(Redirected from Form commands)
Jump to: navigation, search
In the app, form commands are available from the Hamburger menu

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

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.

  1. Edit a form, view, or questionnaire template.
  2. Click Edit (or Buttons or Multi Select in case of views) to open the command configuration window.
  3. To add commands, move them from the Available Commands pane to the Selected Commands pane. Some commands can be added multiple times.
  4. Some commands can be configured. Select the command in the Selected Commands pane and click Properties
  5. To create a new custom command, click New Command. Provide a name and a label, then click OK.
  6. 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.

Command rules are not available in views.

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 a report. For more information read How to run an SSRS report via the Resco Mobile CRM app. Blog
  • RunMobileReport
  • 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 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
Hidden commands
  • UpdateGPS – Sets the current device’s position to record’s latitude and longitude fields, by using Google Maps Services.
  • 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 for 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
  • 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
  • Merge

The following additional commands are available as row buttons.

  • SMS
  • Open
  • Create
  • Call
  • Email

Questionnaire commands

  • Complete and close
  • Complete with a report
  • Cancel the questionnaire
  • Clear answers
  • Run report

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 on your device (with iPad you need to install the CamCard app from iPhone, not the HD version)
  • Obtain Open API key for iOS from Intsig (the company that develops CamCard app) and enter it into app project’s Configuration CamCard ApiKey field. This key is used for both iOS and Android platforms.
Note Intsig has special pricing for Resco customers, you just need to specify that you are Resco customer when contacting them. If you are not already in contact with Intsig, you can let us know and we can give then contact to Intsig.

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.

  1. In an app project, edit a form of an entity. For example, use the Appointment entity.
  2. Click Edit and CheckIn to the Selected Commands pane.
  3. Select CheckIn and click Properties to open the configuration.
  4. 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 time set by the commands.
    • Duration, Latitude, Longitude: Optionally, select additional entity fields. Geographical coordinates must be Float type, 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.
  5. 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 is 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 to actually do anything:

  • Use the form rules On Execute and On Can Execute. (Not available for views.}
  • It is also possible to connect custom commands with offline HTML with Java Script and perform actions that are not available when using command rules.
Note Commands might not be visible in the app if you don't define any actions for them.

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!).

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. Find method is platform-specific (i.e. find on Android Market)
  • DocAction.Download – Saves file in device, platform-specific
  • DocAction.Copy – Copies image to the clipboard
  • DocAction.Paste – Pastes image/file from clipboard
  • DocAction.Print – Prints the document
  • DocAction.ResizeImage – Lets user to choose smaller image resolution
  • DocAction.Import – Lets user import VCard attachment (handled in common code)
  • DocAction.Edit – Allows the document to be edited directly in Resco Mobile CRM application
  • DocAction.SendTo – Creates a new Email with the file/document as an attachment
  • DocAction.Export – Save attachment as a file to the device’s file system
  • DocAction.Email – Send document as attachment

See also FS Mobile: Remove Signature from Notes. Blog

Can 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

Renaming commands

Commands can be renamed using Localization. See Localization examples for inspiration.