Skip to content

Assistants

Used to simplify some complex processes.

assistant CreateCaseAssistant for CasualCaseStruct {  
    label = "Create Case";  
    init command {  
        // command  
    }  
    steps {  
        step {  
            label = "Contact Information";  
            enabled = [CaseTitle != null];  
            valid = [CustomerContact != null];  

            // elements  

            next command {  
                // command  
            }  
        }  
        step {  
            label = "Case Dispatch";  
            enabled = [CaseTitle != null];  
            valid = [Organization != null];  

            // elements  
        }  
        final step {  

            // elements  

            command NavigateToCaseDetail;  
            command HomeCommand;  
        }  
        cancelled step {  
            description = "Cancelled";  
        }  
    }  
    finish command {   
        // command  
    }  
    cancel command {  
        message = "custom message"; //(optional)  
        // command  
    }  
}  

Based on the data entered in the current assistant page, all of the previous assistant steps or the next assistant steps may be disabled. In these cases, the previous button and the next button will be hidden accordingly. If there are no enabled steps after the current step, then the Finish button will appear in place of the Next button. However, this is not valid for steps that are disabled within the “next command” as they require the steps to be disabled after the user selects Next. In this case, there is a chance of the assistant going into the final step, even thought the user had pressed Next (and not Finish).

Returning CANCEL or FALSE (by using the exit keyword) from within the next command, the assistant will not move to the next step.

Limitations

  • The user is only presented with either Next or Finish and never both. This simplifies the process for smaller screens.
  • The user cannot skip ahead or skip backwards to specific questions. They must use Back / Next.

Supported Assistant Properties

  • init
  • finish command
  • cancel command
  • label
  • setup
  • steps

Supported Steps

  • step
  • final step
  • cancelled step

Supported Elements & Properties

  • command
  • commandgroup
  • description
  • enabled
  • group
  • label
  • markdowntext
  • valid
  • visible
  • next command

Finish Command customization

In the finish command there are options for a customizable icon, label and finish message, and can be used as follows

finish command {  
    label = "Click to Finish";  
    icon = "calculator";  
    message = "Are you sure that this is what you want to do?";  

    execute {  
    ...  
    }  
}