Creating a Field Class
Hello;
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…
February 27th, 2009 at 5:07 pm
thanks so bolek, but we want to code which is difficult. my mind is beautiful now. uhahaha.
February 27th, 2009 at 6:49 pm
Hello;
This just explains the basics of field classes. Of course there can be more complex classes, but as everybody’s needs are different I can’t write it to here. If you have specific questions I can answer..
Thanks…
March 9th, 2009 at 8:56 pm
Hi Burak!
I just learned about your site, and I am glad I did. This article answers a question that came up just the other day.
One question however: Let’s suppose that on the work order tracking module I have a reported date and a started date. How would I enforce a rule that the started date could occur before the reported date?
Many thanks again,
/henry
March 9th, 2009 at 11:15 pm
Hello;
You should use java customization to do that.. You can use something like this:
Have a good day…