Uncategorized

Byte #6: Store Sys IDs in User Preferences

The Situation Often times a script will need to reference a particular group (such as an advanced approval script). Best…

The Situation

  • Often times a script will need to reference a particular group (such as an advanced approval script).

  • Best Practice states that scripts should use the sys_id of the group rather than the name (because the name will often change).

  • Referencing a sys_id in a script makes it difficult to change groups in the future, which reduces flexibility.

The Solution

  1. Create a new System Property (table = sys_properties), and store the sys_id as the value of the property.
  2. In your script, reference the system property you created using “gs.getProperty(‘property name here’, ‘default value if desired’)”
  1. After saving, use the related list to assign that System Property to a category.
  2. Create a new module under the related application that uses “URL from