IBM Support

How to create an automation script to retrive a lookup list

Technical Blog Post


Abstract

How to create an automation script to retrive a lookup list

Body

In this example I am going to create an Attribute Launch Point Script for retrieval of Gl Accounts with the GLACCTYPE with ADJ

Step 1: Create A Table DOMAIN                                             
Domain Type Table                                                               
Domain Name LBL_GLACCOUNT                                                       
Object CHARTOFACCOUNTS
Validation Where Clause
GLACCOUNT = :GLACCOUNT
List Where Clause                                                   
GLACCTYPE = 'ADJ'                                                   
Error Message Group
system
Error Message Key
invalidgl

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 2: Create a Script with Attribute Launch Point
Launchpoint Name
LBL_GL_LOOKUP
Launch point Object
WORKORDER
Launch point Attribute
GLACCOUNT
Launch point Event
Retrieve List
Script Name
LBL_GL_LOOKUP
Script Source
domainid = 'LBL_GLACCOUNT'    

image

 

 

 

 

 

 

 

 

 

 

 

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 3: Update Lookups.xml

Add below to your lookups.xml

 <table id="CUSGLNAVIGATOR" inputmode="readonly" selectmode="single">
  <tablebody displayrowsperpage="20" filterable="true" filterexpanded="true" id="cusglnavigator_lookup_tablebody">
   <tablecol dataattribute="GLACCOUNT" id="cusglnavigator_lookup_tablebody_col_1" mxevent="selectrecord" mxevent_desc="Go To %1" sortable="true" type="link"/>
   <tablecol dataattribute="ACCOUNTNAME" id="cusglnavigator_lookup_tablebody_col_2" mxevent="selectrecord" mxevent_desc="Go To %1" sortable="true" type="link"/>
   <tablecol dataattribute="ACTIVEDATE" id="cusglnavigator_lookup_tablebody_col_3" mxevent="selectrecord" mxevent_desc="Go To %1" sortable="true" type="link"/>
   <tablecol dataattribute="EXPIREDATE" id="cusglnavigator_lookup_tablebody_col_4" mxevent="selectrecord" mxevent_desc="Go To %1" sortable="true" type="link"/>
   <tablecol dataattribute="ACTIVE" id="cusglnavigator_lookup_tablebody_col_5" mxevent="selectrecord" mxevent_desc="Go To %1" sortable="true" type="link"/>
   <tablecol dataattribute="GLACCTYPE" id="cusglnavigator_lookup_tablebody_col_6" mxevent="selectrecord" mxevent_desc="Go To %1" sortable="true" type="link"/>
  </tablebody>
 </table>

Step 4: Add a field to Workorder application

In application designer > Go to "WOTRACK" application.
Add a new text field label as "GL Account" and set attribute as GLACCOUNT
Update lookup for GLACCOUNT field to CUSGLNAVIGATOR.

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

From the Workorder main application you can retrieve the desired GL Accounts

image


 

 

[{"Business Unit":{"code":"BU005","label":"IoT"}, "Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm11131891