How to set properties of the Option variable?

How to send properties of the Option variable? I would like to set “OptionString” property from C/AL code With best regards, Andrew

Example: Field Status with options: Open, Released.


Status := Status::Released;

Hint, to figure out the possible options in code use some babble after the :: like Status::ddd - this will show you the possible values. /Soren

I don’t think it’s possible to set the option string from code. Kind regards, Jan Hoek Weha Automatisering BV Woerden - The Netherlands

Soren is right, but there is a shotcut; Example: Field Status with options: Open, Released. to set the field value to Released there is to methods: Status := 2; gives the same result as Status := Status::Released; This is because Navision stores the number of OptionString, not the string itself. - but then you have no idea what the status=2 means the next time you’ll check out the code. Therefore; use Sorens method, not mine. -Arve

Thank you! With best regards, Andrew