Skip to content

Commands

Commands provide a generic way of defining a button which can have an execute behaviour.

If a page command uses a single navigate execution it will display as a related page to the side rather than with the rest of the commands at the top of the page.

command AcceptTaskCommand {  
   label = "Accept";  
   style = IconOnly;  
   icon = "mail";  
   variable VarTaskMsgAccept;  
   variable VarAcceptTaskOrgId;  
   enabled = [(Objstate = "Queued" or Objstate = "New")];  
   execute {  
      // execute here  
   }  
}  

Supported Command Properties

  • emphasis
  • enabled
  • execute
  • icon
  • label
  • style
  • variable
  • visible

Executions

Call (Action or Function)

Partially supported

call CompletionAction(CompletionTemp, FocusIdTemp) into TempVar;  

Limitations

  • All calls are asynchronous so cannot return results. We cannot wait for data to come back from the server. If the app is offline we cannot get a response.
  • Call using the ‘into’ statement is only supported if an offline procedure has been implemented which returns a value.

Partially supported

navigate TimeReportsPage(WoNo);  
navigate back;  
navigate "ifs-map://location?lat=123&long=123";  
navigate "ifs-map://location?address=abcefg";  

To navigate back to a specific page, follow the example below

navigate {  
   page WorkOrderListsPage {  
      mode = BackRetainFullscreen;  
   }  
}  

The mode can be set to either one of the following

  • BackRetainFullscreen
  • If for example you have navigated through to a full screen list, this will return to that list
  • Back
  • If you have navigated through to a full screen list, this option will take you back to the page that opened that list
  • Forward (default)
  • This is effectively the same as doing: navigate WorkOrderListsPage;

Limitations

  • Only the declarative format is supported. Using URLs* is not applicable within a native app since the application is not ran within a web browser.
  • *Map URLs which are defined in the format above will open the native map application (Bing maps for Windows, Google maps for Android and Apple / Google maps for iOS) to display the location specified. Must have either latitude and longitude, or address parameters.
  • If navigating Back or BackRetainFullscreen to a page you have not visited before, the command will not do anything.

Print

See the Reporting documentation for more information on how to use the print keyword.

Upload

Upload from commands support uploading to media, documents and binary attributes. The upload does not happen straight away and instead is queued to be done during the sync processes.

The name of the file being uploaded can be accessed in the call using component.FileSelectorName.UploadingFile.

Media

// variable MediaKeys {  
//     type = Structure(FndMediaKeys);  
// }  

upload "MediaItemSet(ItemId=$[MediaKeys.ItemId])/MediaObject" from MediaFileSelector {  
    call CreateAndConnectMedia(LuName, KeyRef, "Name") into MediaKeys;  
}  

When the above specific upload location is detected it is treated as a media attachment.

The CreateAndConnectMedia call should be implemented from an offline procedure using the Attachment.CreateAndConnectMedia system call. See the procedures documentation for more information.

Documents

// variable DocumentKeys {  
//     type = Structure(FndDocumentKeys);  
// }  

upload "DocIssueSet(DocClass=$[DocumentKeys.DocClass],DocNo=$[DocumentKeys.DocNo],DocSheet=$[DocumentKeys.DocSheet],DocRev=$[DocumentKeys.DocRev])/EdmFileReferenceArray(DocClass=$[DocumentKeys.DocClass],DocNo=$[DocumentKeys.DocNo],DocSheet=$[DocumentKeys.DocSheet],DocRev=$[DocumentKeys.DocRev],DocType='ORIGINAL',FileNo=1)/FileData" from DocumentFileSelector {  
    call CreateAndConnectDoc(LuName, KeyRef, "Title") into DocumentKeys;  
}  

When the above specific upload location is detected it is treated as a document attachment.

The CreateAndConnecDoc call should be implemented from an offline procedure using the Attachment.CreateAndConnectDoc system call. See the procedures documentation for more information.

Binary Attributes

upload "WorkOrders(WoNo=$[WoNo])/Image";  

Sets the binary attribute in the specified record to be the file data. The data in the client database is updated and a message is queued to update the server attribute at the next sync.

Barcode

command CommandBarcode {  
   variable VarA;  
   label = "Barcode Test";  
   enabled = [true];  
   execute {  
      barcode into VarA {  
         when OK  
            {  
            alert("${VarA}");  
         }  
         when CANCEL  
            {  
            alert("Cancel");  
         }  
      }  
   }  
}  

Sets the value from a barcode scan into a variable.

Signdocument

Partially supported.

command SignCommand for EsigRecordWorkVirtual {
   label = "Sign";
   …
   variable SignResponse {
      type = Structure(EsigResponseStructure);
   }
   execute {
      signdocument into SignResponse {
         filenameprefix = " ${AircraftID }";
      }
      if [SignResponse.State = "SUCCESS"] {
         call SignRecordWork(TaskId);
      }
      exit;
   }
}

Set file name

To set the file name prefix of the signed documents follow example.

signdocument into SignResponse {
         filenameprefix = " $ {AircraftID}”;
 }

Final file name would look like + GUID.pdf

A header logo can be added to the signed documents from a framework resource or from the media library of a specified entity.

To add a header logo from a framework resource follow example

set LogoUrl = "FrameworkServices.svc/AppearanceResources(FileName='image.png')/FileData"; 
signdocument into SignResponse { 
     headerlogo = LogoUrl; 
 } 

To add a header logo from the media library pass the entity and keyref as follows:

set LogoUrl = "AvExeTaskMeasurement:MEASUREMENT_ID=1^"; 
signdocument into SignResponse { 
      headerlogo = LogoUrl; 
 } 

Note: If framework resource is used then this image is retrieved at runtime when the assistant is loaded or when the command is clicked and is therefore an online call. If there is a need for the logo to be available for offline signing flows then the media library option must be used.

Signing Response

The signdocument call in the client model will return a structure. The structure will have the status as well as the GUID generated during the signing process. In order to use the EsigResponseStructure , FndEsignature fragment within FNDBAS component should be referenced by the .projection files. See the Including eSignature fragments in Mobile Apps documentation for more information on how to include the fragment..

The following example sets the value from a signing attempt into a EsigResponseStructure variable.

command SignCommand for EsigRecordWorkVirtual {
   …
   variable SignResponse {
      type = Structure(EsigResponseStructure);
   }
   execute {
      signdocument into SignResponse {
            …
      }
      alert("Signing outcome: ${ SignResponse.Guid} - ${ SignResponse.State}");
   }
}

Limitations

  • File name max length is 100, since File Storage Service has a limit of 100 chars.
  • documenttype is not supported.

Transfer and Receive

See Transfer and Receive documentation for more information

Location

command ShowLocation {  
   label = "Show Location";  
   enabled = [true];  
   variable Latitude Number;  
   variable Longitude Number;  

   execute {  
      location into (Latitude, Longitude);  
   }  
}  

Gets the users device location (latitude and longitude) using GPS.

The expanded form can be used to see if retrieving the location succeeded. This will return CANCEL if location tracking has been disabled by the user or application parameters.

location into (Latitude, Longitude) {  
   when OK {  
      alert("${Latitude}, ${Longitude}");  
   }  
   when CANCEL {  
      alert("Unable to get location");  
   }  
}  

Other Supported Executions

  • dialog
  • toast
  • exit
  • confirm
  • inquire
  • alert
  • set
  • if
  • set