Is there a better of doing the following:
shipmentLine.getMDF("OMS", "PONumber")
Hard coding the constants for the model (OMS) and field (PONumber) smells funny.
A better way is:
shipmentLine.getMDF(ShipmentLineMDFS.class)).getPONumber()
And similarly to set the value:
shipmentLine.getMDF(ShipmentLineMDFS.class)).setPONumber("whatever")
What to do if the mdf is defined in a different module?
For example, there is an mdf called international defined on shipment header model in SCC module.
What should i do to set the mdf value from TMS module without hardcoding the module prefix like
shipment.setMDF("TMS", "International", false);
// use the MDFs class from the specific module in which mdf is defined
shipment.getMDF(com.onenetwork.scc.ShipmentHeaderMDFs.class).setInternational(false);
If its a "*.model" you can use the the "Spy" class. Fill in your "MODEL" and "Field".
MODELSpy.FIELD