Option, Class and language

galmokgalmok Member Posts: 44
While doing such a simple thing as inserting orders into the sales header/line tables, I was using this syntax to set the Document Type:


SalesHeader.VALIDATE("Document Type",SalesHeader."Document Type"::"Order");


I use this mostly because I don't know the integer value I could use instead but also so I easily can use option values from other tables. But I am wondering what the above line does when I change the language to e.g. Danish. "Order" in Danish is "Ordre".

Will Navision always use the english term ("Order") or be localised? If it is localised, is my only option then to use the integer value? (and what is that value for Order) ;-)

Comments

  • krikikriki Member, Moderator Posts: 9,110
    It is always "Order". In the DB is saved the integer value and when you open the editor you see the option value in ENU.

    BTW : you should ALWAYS use the option-value in programming and NEVER the integer value. The only thing you may do is to put the option in an integer (e.g. as a parameter for a function) and then use that integer, but if you want to test it, you must use again the option-value.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • galmokgalmok Member Posts: 44
    Thank you for the advice. I did use an integer prior to my first request but decided it didn't look good and there had to be a better solution. I wasn't sure the solution I found was the right one, but thanks for confirming it. :-)
Sign In or Register to comment.