IBM Support

Scripting solutions for error "BMXAA0019I - The field is either read only or part of the primary key. You cannot edit this field"

Technical Blog Post


Abstract

Scripting solutions for error "BMXAA0019I - The field is either read only or part of the primary key. You cannot edit this field"

Body

You may have written some scripts for Maximo 7.5 version which worked correctly but the same script failing on Maximo 7.6. You will receive the above error.

This is an example how to resolve the error.

This script simply copies the Target Start, Target Finish date to the Scheduled Start and Scheduled Finish date

Go to Automation script create an attribute launch point for object workorder

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The script is :

if (siteid == 'BEDFOR' and worktype == 'PM'):
   schedstart = targstartdate
   schedfinish= targcompdate

Which checks for the site "BEDFORD" and worktype of "PM". If it meets the condition will copy the dates.

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This script works correctly in Maximo 7.5

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

However the same script will receive an error if you try to run on Maximo 7.6 due to some validation. So the script needs to be modified to bypass the validation error. So simply update the script to NOACCESSCHECK.

if (siteid == 'BEDFORD' and worktype == 'PM'):
   schedstart = targstartdate.NOACCESSCHECK
   schedfinish = targcompdate.NOACCESSCHECK
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

UID

ibm11129575