Creating a script

  1. Log on to Sage CRM as a system administrator.
  2. Go to <My Profile> | Administration | Customization | <Entity> | TableScripts.
  3. Click New.
  4. Complete the following options and click Save:
    • Name. Enter a descriptive name with which you want to identify the script in the Sage CRM user interface.
    • Windows User as Domain\User (Optional). Enter the Windows user account under which you want to run the script. Use the format domain\user name. If you leave this option blank, the script is run under the current user account.
    • User Password. Enter the password that matches the user account specified in Windows User as Domain\User (Optional).
    • Script Type. Select the type of your script.
    • View. Only use this option when creating entity-level scripts. Enter the view from which fields are available in the script. This must be relevant to the current entity. If you leave this option blank, the default view for that entity is used.
    • Order. Specify the order of scripts if there's more than one script for a table.
    • Logging Level. Select the logging level to use when a user clicks Show Log:
      • Off. Disables logging.
      • Low. Writes low-level diagnostic information in the log table.
      • Medium. Writes medium-level diagnostic information in the log table.
      • High. Writes high-level diagnostic information in the log table.
    • On error, only display the default error message. Select this check box to hide error details from users. You can enter an alternative error message in Default Error Message. If you select this check box but don't enter a default error message, no errors are shown to the user.
    • On error, retry the script after delay. Select this check box to re-run the script after a defined amount of time when an error occurs. The script is automatically re-run until it completes without errors. This is useful for situations where an external resource is temporarily available. Every time the script is re-run, the amount of time until Sage CRM retries the script is increased.
    • Table level script. Use this text box to enter your table- or entity-level script. Depending on the type of script you want to run, enter your script in the appropriate section. That is, function InsertRecord(), function PostInsertRecord(), function UpdateRecord(), or function DeleteRecord().
    • Disabled. Select this check box to disable the script. To enable the script, clear this check box.