Creating a Field Class
Author: admin Post Date: February 24 2009Hello;
Another basic java functionality is to create a field class. Assume that you have a field. And if it is filled you have to make it readonly to prevent anyone changing the field. I’ll assume this field is WORKORDER.ASSETNUM… To do this we have to extend psdi.app.workorder.FldWOAssetnum class which is default class for this field. Here is the basic code..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | package custom.workorder; import psdi.mbo.*; import psdi.util.*; import psdi.app.workorder.FldWOAssetnum; import java.util.*; import java.rmi.*; public class newFldWOAssetnum extends psdi.app.workorder.FldWOAssetnum { public newFldWOAssetnum (MboValue mbovalue) throws MXException, RemoteException { super(mbovalue); } public void init() throws MXException { super.init(); if(!getMboValue().isNull()) //If the value is not null { getMboValue().setReadOnly(true); //make it readonly } } } |
After this you have to write ‘custom.workorder.newFldWOAssetnum’ to the class field of WORKORDER.ASSET in database configuration.
Run configdb
Build maximo.ear
Redeploy maximo.ear
Have a good day…