Skip Navigation LinksALVAO 11.2Extension modulesALVAO Service Desk Custom AppsApplicationsCustom commandsICommand (deprecated) Skip Navigation Links.


Skip Navigation LinksALVAO 11.2 / Extension modules / ALVAO Service Desk Custom Apps / Applications / Custom commands / ICommand (deprecated)

ICommand (deprecated)

Caution:
This interface is deprecated. Instead of this interface use the IEntityCommand interface.

By implementing the ICommand interface in the application script, you can define custom ticket commands.

In the application, create a new script using the ICommand template and name it appropriately according to the functionality of the custom command.
In the newly created script, set the id, name, position, and icon property values in the constructor of the command class:

  • id - command number (unique)
  • name - the name of the command that will be displayed in applications
  • position - the position at which the command will be displayed in applications
    • 1 = at the first position of the main ticket menu
    • 2 = at the last position of the main ticket menu
    • 3 = at the first position of the nested menu in the main ticket menu
    • 4 = the last position of the nested offer in the main offer of the ticket
  • icon - the name of the command icon
    • Use the icon name from the Microsoft Fabric library as the command icon name (the icon name will appear on the page when you hover over the selected icon). If you do not specify an icon, the LightningBolt icon is used.
Tip:
To store the properties and settings of the command, we recommend defining the Settings class in a separate script that you create from the Class Library template.

Interface methods

Method Description
Show Display the command in the ticket menu.
Run Run command.

Show

This method checks the defined conditions for displaying the command.
Tip:
By calling this method in the Run method, you can check if the conditions for displaying the query have changed between the time the query was displayed and the time the query was run.
  • Syntax: bool Show(SqlConnection con, int ticketId, int personId)
  • Parameters:
    • con - SqlConnection to the database.
    • ticketId - The ticket ID (tHdTicket.iHdTicketId) for which the command will be displayed.
    • personId - the ID of the user (tPerson.iPersonId) to whom the command should be displayed.
  • Return values:
    • bool - the truth value of whether the command should be displayed to the user on the specified ticket.
You can find an example use case in the CostsCalculation application template.

Run

This method runs the command itself.
Tip:
If the custom command is to open a different page from the Alvao WebApp, use the Alvao.API.Common.DbProperty.WebAppUrl property from the Alvao.API interface to get the root URL.
  • Syntax: Tuple<bool, string, string> Run(SqlConnection con, int ticketId, int personId)
  • Parameters:
    • con - SqlConnection to the database.
    • ticketId - The ticket ID (tHdTicket.iHdTicketId) over which the command is run.
    • personId - The user ID (tPerson.iPersonId) that is running the command.
  • Return values:
    • bool - the truth value of whether the command was executed.
    • string - text that can be displayed in the message to the user.
    • string - URL to open in the browser.
You can find an example use case in the CostsCalculation application template.

 

Did not find what you were looking for? Ask our technical support team.