{"id":296,"date":"2019-08-05T16:51:35","date_gmt":"2019-08-05T16:51:35","guid":{"rendered":"https:\/\/www.dabbler.dk\/?p=296"},"modified":"2019-08-05T16:51:35","modified_gmt":"2019-08-05T16:51:35","slug":"option-value-optionml-value","status":"publish","type":"post","link":"https:\/\/www.dabbler.dk\/index.php\/2019\/08\/05\/option-value-optionml-value\/","title":{"rendered":"Option value != OptionML value"},"content":{"rendered":"\n<p>Do you need some way of getting the Option value instead of the OptionML value from an Option field?<\/p>\n\n\n\n<p>It is not so straight forward as one should think, but with this simple function the work is done for you:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PROCEDURE GetOptionValue@1000000002(TableId@1000000001 : Integer;FieldId@1000000000 : Integer;Value@1000000002 : Integer) : Text;\nVAR\n  TableRef@1000000003 : RecordRef;\n  FieldRef@1000000004 : FieldRef;\nBEGIN\n  \/\/Example:\n  \/\/  MESSAGE(KMCTools.GetOptionValue(DATABASE::\"Sales Line\",SalesLine.FIELDNO(Type),SalesLine.Type::Item));\n  TableRef.OPEN(TableId);\n  FieldRef := TableRef.FIELD(FieldId);\n  EXIT(SELECTSTR(Value+1,FieldRef.OPTIONSTRING));\nEND;<\/pre>\n\n\n\n<p>Free of charge &#8211; but use on your own risk&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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; VAR TableRef@1000000003 : RecordRef; FieldRef@1000000004 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.dabbler.dk\/index.php\/2019\/08\/05\/option-value-optionml-value\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Option value != OptionML value&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":190,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,5],"tags":[32,25,24,26],"class_list":["post-296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-nav","category-software","tag-business-central","tag-dynamics","tag-microsoft","tag-nav"],"_links":{"self":[{"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/posts\/296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/comments?post=296"}],"version-history":[{"count":1,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/posts\/296\/revisions"}],"predecessor-version":[{"id":297,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/posts\/296\/revisions\/297"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/media\/190"}],"wp:attachment":[{"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/media?parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/categories?post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/tags?post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}