Pages

Wednesday, February 22, 2017

Concatenate two fields using automation script

Goal:
To create an automation script in Maximo 7.5 that combines two fields into a new field and is triggered by the change of one of the fields.



Example:
I have two fields in my application and want to combine those fields into one new field. 

One field on the record contains a project number (say: PROJECTNUM) and the other field contains a number unique for that project (say: PROJECTID). The unique identifier for the record should be the project number + number (say: PROJECTUID).

Launch Point Type: Attribute Launch Point
Attribute: PROJECTNUM / PROJECTID
Code:


from psdi.mbo import MboConstants
projectNum = mbo.getString("PROJECTNUM")
projectID = mbo.getString("PROJECTID")
projectUID = projectNum + projectID
mbo.setValue("PROJECTUID",projectUID, MboConstants.NOACCESSCHECK)


No comments:

Post a Comment