Write OptionString to file

I’m trying to write the definition of any or all tables to a file. Want to write TableRelation and found this in Field.RelationTableNo. My problem is when a field is option, I’d like to write the OptionString of that field. Is it possible to get this info in C/AL? Thanks Fredrik

Yes, it’s possible, but a bit complicatelly. You have to use iteration through option data type variable. Example: //As opt. used “Document Type” of Sales Line SalesLine.“Document Type” := 0; txt_MyOptionString := ‘’; i := 0; REPEAT txt_MyOptionString := txt_MyOptionString + FORMAT(SalesLine.“Document Type”) + ‘,’; i := i + 1; SalesLine.“Document Type” := i; UNTIL FORMAT(SalesLine.“Document Type”) = FORMAT(i); MESSAGE(DELSTR(txt_MyOptionString,STRLEN(txt_MyOptionString),1)); Jozef Kovac

Great! Thanks Jozef! [:)]