Thursday, May 5, 2016

How to get a field directly from args when opening a form.

The standard code I used to get a field from args was

InventTrans inventTrans = element.args().record() as InventTrans;

info(int642str( inventTrans.recID));

Recently found a way to just use

info(int642str(element.args().record().(fieldNum(InventTrans, RecId)))); 

which save all the work of type casting and does it all in one line.

No comments:

Post a Comment