Option value != OptionML value

Do you need some way of getting the Option value instead of the OptionML value from an Option field?

It is not so straight forward as one should think, but with this simple function the work is done for you:

PROCEDURE GetOptionValue@1000000002(TableId@1000000001 : Integer;FieldId@1000000000 : Integer;Value@1000000002 : Integer) : Text;
  TableRef@1000000003 : RecordRef;
  FieldRef@1000000004 : FieldRef;
  //  MESSAGE(KMCTools.GetOptionValue(DATABASE::"Sales Line",SalesLine.FIELDNO(Type),SalesLine.Type::Item));
  FieldRef := TableRef.FIELD(FieldId);

Free of charge – but use on your own risk…

Leave a Reply

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *

2,698 Spam Comments Blocked so far by Spam Free Wordpress