Page tree
Skip to end of metadata
Go to start of metadata

Action Buttons

The Action Button data type creates a button that can be placed on the layout which performs a specified action or set of actions. Action buttons can be designed to perform a great variety of possible functions - since they can run almost any of the standard action types, you can use action buttons to send emails, update fields, update linked records, print documents from a template, or all of those at once.

Create an Action Button

In the Fields tab of a Table wizard, select New > Action Button to open the Action Button wizard. 

Select the Add Action button to add or edit actions that should be executed when this button is clicked. You can change the order of action execution by dragging actions up or down with the mouse. For more information on the available action types, see: Actions.

Define the Order of Actions

In the General tab of the wizard, you can add any number of actions and define the order in which they must appear when the button is pressed, and what events should happen before and after the actions. 

Before and after the actions, the record can optionally be saved. If the record is saved before or after the actions, you can choose whether to validate all of the required fields in the record, and whether to run the rules that are active on the table. If you choose to bypass the required fields validation or rules, there is a risk that the record could be saved in an incomplete state. Exercise caution when deselecting these options as there is a possibility for records to be canceled in the middle of being created, in a state where mandatory fields are incomplete, or they cannot be acted upon by normal table rules.

The Add Wait Point button is used to cause the system to wait for the preceding action(s) to complete before running the next action or moving to the final step defined in the After executing actions section. This is useful if one of the actions brings up a new window for a manual conversion or runs actions on records in a related table that should be reflected in this table record before proceeding.

If you select Open a URL provided by, it will be opened at the specified URL that may include variables from the record.

If the action button opens a script in a window with a URL that is defined by a Script Action, the last script in the list of Execute Actions could use EWset::setRedirect to define what this URL should be.

If you enter the URL manually, please, note that URL to open is a formula and special syntax is required.

  • If you want to open a static URL, enter your URL enclosed in double quotes. For example "http://www.agiloft.com".
  • If you want to open a URL, where the main address depends on some record data, you should concatenate static parts, enclosed in double quotes and fields or variables names (prefixed by $) using a plus sign. For example, if your record contains a field named “company”, you could specify a URL like "http://www." + $company + ".com" to go to the company site. Please note that you should not use urlEncode() in this case.
  • If you want to open a URL, where parameters (after the main address) depend on record data, you should concatenate fields variable names (prefixed by $) enclosed in urlEncode() while enclosing the static parts in double quotes with a plus sign.
    • Such URL parameters are easy to identify because they come after an equals (=) sign. For example, if you have a URL such as http://www.agiloft.com?login=myLogin&password=myPassword, then "login" and "password" are URL parameters and "myLogin" and "myPassword" are the parameter values.
    • To compose such a URL using fields from the current record, you would write: "http://www.agiloft.com?login=" + urlEncode($myLogin) + "&password=" + urlEncode($myPassword)
    • Note on urlEncode(): Every web server detects parameters and their values in a URL string by locating ?&= characters. That means that a URL parameter value should not itself contain any of these characters, otherwise the web server will not be able to recognize the correct parameter value. To avoid this confusion, each parameter that uses a field variable with $ should be URL-encoded, so that dangerous characters in each parameter value are replaced with "safe" character sequences.  The server will understand these sequences and convert them back to source characters when reading the parameters string.
      If you add variables through the Formula Wizard, variables are added with urlEncode() function for you. 
      You should always use this function, if you are using the variable or field in the parameter part of a URL like "www.b2b.com?param=" + urlEncode($field).
      You should not use this function when your field or variable is used in the main address part of the URL, such as "http://www." + $company + ".com".

Required Field Validations and Rule Triggering

When an action button is set to save a record after being pressed, it is possible to bypass the validations for mandatory fields, and the rules and updating of values that would normally be enforced on the table upon record save. In the General tab of the Action Button wizard, before and After executing actions when the option is set to Save Record, the following options are presented:

  • Validate required fields - if deselected, upon activating the button the record can be saved in a state where mandatory fields have not been entered, or entered incorrectly.
  • Run rules and update default values - if deselected, upon activating the button the record will be saved without triggering  the rules and default value updating that would normally be enforced on the table.  

In the section After executing actions, the Validate required fields option is only available when choosing to Save and Open record for edit - this is in order to prevent the record being closed in a state where mandatory fields have not been filled in. Since these options can result in records being saved in an incomplete state, and then have further rules run on them that could cause issues with business processes, it is advisable to exercise caution when deselecting either of them. By default, both options are selected for existing action buttons where the "save record" option is selected.

These options can be useful in cases where for instance a record contains a large number of tabs, and a user wishes to use an action button to save the current state and send something forward before the final tab, while still continuing to work on it. 

Additional Actions

Aside from the available action types, there are a number of options that can be selected by clicking the drop-down menu after the actions. These include:

  • Running an ActiveX script
  • Opening a URL - see the notes above on URL functions
  • Making a Skype call
  • Adding a note
  • Opening the Email wizard to create an email
  • Sending a PayPal payment