IBM Support

Automation Scripting – Object Launch Point – Setting field as readonly

Question & Answer


Question

How can a field be set to readonly using Automation Scripting?

Answer

In the following example, the REPORTEDBYID field will be set as READONLY within the SR application when the record is added/updated/initialized.

1) Go To – System Configuration – Platform Configuration – Automation Scripting – click on Select Action – Create – Scripting with Object Launch Point:



2) Within the 'Create Script with Object Launch Point : Step 1 of 3' add the following:

Launch Point: REPORTEDBYID
Description: Setting REPORTEDBYID to READONLY
Active: CHECKED
Object: SR
Add? CHECKED
Initialize? CHECKED
Update? CHECKED



Click on the 'Next' button.

3) Within the 'Create Script with Object Launch Point : Step 2 of 3' add the following:

Script: REPORTEDBYID
Description: Setting REPORTEDBYID to READONLY
Script Language: jython



4) Within the Variables pane, click on New Row. Add the following:

Variable: REPORTEDBYID
Variable Type: INOUT
Override? CHECKED
Binding Type: ATTRIBUTE
Launch Point Attribute: REPORTEDBYID



5) Click on Next button. Within the 'Create Script with Object Launch Point : Step 3 of 3' add the following script:

if REPORTEDBYID is not None:
REPORTEDBYID_readonly = True



Click on the Create button. Correct any error that may appear. The following dialog will be displayed:



7) Access the SR application – create a new SR – add a REPORTEDBYID:



Click on Save – The 'Reported By' field will now be READONLY:

[{"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"System Related","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.5","Edition":"All Editions","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
17 June 2018

UID

swg21648328