Reputation: 1887
I have a text variable which I want to convert into a option and set table data with it. How do it convert the variable into a option?
Thanks
Upvotes: 2
Views: 12207
Reputation: 126
// Option to text:
optionName := format(salesHeader."Document Type"::Order);
// Text to option:
case (optionName) of
'Order': salesHeader."Document Type" := salesHeader."Document Type"::Order;
'Invoice': salesHeader."Document Type" := salesHeader."Document Type"::Invoice;
end;
Upvotes: 0
Reputation: 712
Should you still wish to convert a string to an option value, EVALUATE is the way to go! :)
Upvotes: 6
Reputation: 1887
Solved,
OptionName := OptionName::Option;
This does not solve the question itself, but is a workaround since "Option" can be a text String (But it must be a predefined one);
Upvotes: 1