Sage CRM 2024 R1: Create Scripts - A round up of essential articles

3 minute read time.

Sage CRM Create Scripts provide a powerful tool for implementing business rules. These scripts are executed on the server side whenever a screen is created. This allows system administrators to control how a screen behaves. They allow administrators to enforce specific business logic as a screen loads. They can be used for tasks like setting default values for fields, checking data for accuracy, or triggering specific actions when the screen loads. 

  • Create Scripts in Sage CRM are written at the level of the field.
  • Each field within a screen in Sage CRM can have its own Create Script.
  • This script specifically targets the field it's attached to and can access and modify data related to that particular field.
  • While a Create Script can't directly manipulate other fields on the screen, it can trigger actions that might affect them indirectly, like setting error messages.
  • Create Scripts themselves cannot directly stop the record from being committed but when used with Validation rules they can enforce business rules.

Sage CRM offers two other types of Field Level Scripting:

  • Validate Scripts
    • These scripts run on the server-side when a user attempts to save a record. Their primary function is data validation. Validate Scripts can check the data entered in the field against pre-defined criteria and prevent the record from being saved if the data fails validation. They can also set error messages to guide the user towards correcting the issue.
  • OnChange Scripts
    • These scripts are executed on the client-side (user's web browser) whenever the value in the field is changed. They offer more flexibility for dynamic behavior on the user interface. OnChange Scripts can be used for various purposes like:
      • Updating other fields based on the changed value.
      • Triggering calculations or data lookups based on user input.
      • Providing real-time feedback to the user regarding data validity or potential issues.

Each script type has its own scope and functionality. System Administrator should choose the appropriate script based on what they want to achieve:

  • For initial setup and default values: Create Scripts
  • For data validation during save: Validate Scripts
  • For dynamic behaviour as the user interacts with the field: OnChange Scripts

Below are the links to articles covering all aspects of work with Create Scripts

Understanding Context, Scope of Reference and Scope of Effect

  • Scope of reference refers to the visibility and accessibility of variables, functions, and other named elements from a specific point in your Create Script. It's about where you can look to find the definition of something you're using.
  • Scope of effect focuses on the parts of your Create Script that are actually modified or impacted by a particular function or method. It's about what parts of Sage CRM experience the changes introduced by a specific script.

Create Scripts and Security

Controlling Screens

Controlling Fields in Screens

Controlling Fields in Search Screens

Controlling Fields in Screen TopContent

Controlling Columns in Lists

Create Scripts in Workflow

Mobile