IQDoc
ITIQPro Docs Maintenance Connection Everywhere (MCe) · EAM/CMMS manuals
Read preferences in script
to vary how your report will operate

TL;DR

There is a 'preferences' object that you use to get preferences.

It has three normal sets of functions:

Get<datatype>(string preference)
GetRepairCenter<datatype>(string preference, string RepairCenterID)
GetUser<datatype>(string preference, string UserID)

Example use: GetInteger('system-calendar-first-day-of-the-week')

Details

Base Call types:

  • Get... (preference)
  • GetRepairCenter... (preference, ID)
  • GetUser... (preference, ID)

Where the ... is replaced with one of the DataTypes below

DataTypes:

  • String
  • Boolean
  • Integer
  • Decimal
  • Double
  • RawJson

Some sample calls include:

GetString('some-string-returning-preference')
// you need to change the 'some-string-returning-preference' to a real value of a preference that returns a string
GetRepairCenterInteger('some-integer-returning-preference', 'Main')
// you need to change the Repair Center ID to some real ID in your system,
// you may want to have code that looks the Repair center up or gets it from a dataset
// and you'll need to change the preference to a real preference, one that returns an Integer in this sample
GetUserRawJson('some-JSON-returning-preference','PHorwood')
// you need to change the User ID to some real user ID in your system
/// you may want to have code that looks the User ID up
// and you'll need to change the preference to a real preference, one that returns a JSON in this sample

In the samples you see there are 3 ways to get the preference:

  • The Get set look at a company level
  • The GetRepairCenter set look at the Repair Center level, and if not specified there, look at the company level
  • The GetUser set look at the user, if not specified there, look at the Repair Centre and if not specified there, look at the company level.

As far as the data type, it will usually be obvious by the preference you are reading.

Since the only supported scripting language is Javascript right now, GetInteger, GetDouble and GetDecimal return exactly the same values - GetInteger doesn't force 1.67 into an Integer.