How to get the option value of a Option var?

chandrurec
chandrurec Member Posts: 560
Hi all,

I am having a option variable named "Sales Type" field in Sales Invoice Header table with option strings such as '',Local Sale, High Sea Sale,SEZ Sale ....

when I put the message of the Sales Type field , I am getting the string name as Local Sales but I should get the value of the corresponding string (i.e1).

For Ex, When I select the "Sales Type" as High Sea Sale then I should get the message as 2 .

Is it possible to achieve this?

If so , Kindly tell me how to get the option value in message.

Thanks in advance.

Regards,
Chandru.

Comments

  • FlowerBiz
    FlowerBiz Member Posts: 34
    FORMAT(fieldname,0,2)

    This should return the numeric value of the option instead of the option text.
  • kriki
    kriki Member, Moderator Posts: 9,121
    or another trick:

    intSomeInteger := "Sales Type".

    internally, an option is an integer field, so you can use that.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • chandrurec
    chandrurec Member Posts: 560
    Hi FlowerBiz/Kriki,

    Thanks a lot . I can able to get the option value uisng both of your techniques.

    Regards,
    Chandru.
  • David_Singleton
    David_Singleton Member Posts: 5,479
    chandrurec wrote:
    Hi FlowerBiz/Kriki,

    Thanks a lot . I can able to get the option value uisng both of your techniques.

    Regards,
    Chandru.


    Both work, but Kriki's is the preferred way to do this.
    David Singleton