How can i assign VALUE,CAPTION Using OPTION Type ??

pskannaapskannaa Member Posts: 138
Hi,

I need to store the values like

"Transaction Type"(Dropdown) -->
Value : Order ->should be showing caption is "Purchase Order"
Value : Return ->should be showing caption is "Sales Return"


So, when user is selecting the "Transaction Type" and they can see only "Purchase Order","Sales Return"

If choose "Purchase Order" i need to get the relavent VALUE for calculating purpose i.e "Order"
If choose "Sales Return", get the relavent VALUE for calculating purpose i.e "Return"


Regards,
Psk

Comments

  • krzychub83krzychub83 Member Posts: 120
    By setting the Properties: OptionCaptionML. If it is a Global/Local variable, by seting the properties of TextBox in which SourceExpr is set to this variable.

    OptionString: ,Order,Return
    OptionCaptionML:ENU=" ,Purchase Order,Sales Return";PLK=" ,Zamówienie zakupu,Zamówienie zwrotu sprzedaży"
  • pskannaapskannaa Member Posts: 138
    I also use the same in the 'FIELD' property
    eg:

    Field: "Transaction Type" ->property->SET
    OptionString: ,Order,Return
    OptionCaptionML:ENU=" ,Purchase Order,Sales Return"

    When i print the value it's showing "Purchase Order" only not "Order"

    or Is't need to set the 'option' in VARIABLE and assigned it into FIELD(transtype) ???????
  • krzychub83krzychub83 Member Posts: 120
    Sorry I misunderstand You. Do You want to customize captions at the run-time?
    If You have set up captions, system (by default) is going to use them. So whenever You will use this variable, You are going to get caption of chosen value as result.

    There are some possibilities of changing it, like this:
    viewtopic.php?f=5&t=6746&hilit=CodeUnit.run
  • pskannaapskannaa Member Posts: 138
    I'm sorry , confusing !!!!

    want i need exactly is
    While creating Table i hav set the Field "Transaction Type" is OPTION and goto property,SET
    OptionString:" ,Order,Return"
    OptionCaption = " ,Purchase Order,Sales Return"
    OptionCaptionML:ENU=" ,Purchase Order,Sales Return"

    then, create form based on the table.

    When i select the DropDown(TransType) is 'Purchase'

    code: Message(Rec."Transaction Type");

    here the output is showing only "Purchase"
    but i need to get the corresponding CAPTION value i.e "Order"
  • DenSterDenSter Member Posts: 8,304
    Why don't you just keep the option values and the option caption values the same? That way your code will always reflect actual values, and it will be much easier to read the code. There is no reason that I can think of why you would need to do this.
  • pskannaapskannaa Member Posts: 138
    My customization User wants to show/Display the "Transaction Type" is "Purchase" and it will be Matching the Transaction type while creating "Purchase Order", so that i can match the "document type" of PO Card.

    Like
    If myform.Transaction type = Poheader.Document type Then do statements...
    ..............
    ..............
  • garakgarak Member Posts: 3,263
    I doesn't understand your problem.
    First you set the correct optionString and Option Caption in the Field self

    Property OptionString: Purchase Order,Sales Return
    Property OptionCaptionML: ENU=Purchase Order,Sales Return;YOULANGUAGECODE=Purchase Order,Sales Return

    So the system will ever display the string Purchase Order or Sales Return.
    If you need on the form self a other optiondescription, you can change the property OptionCaptionML on the control on the form also.
    for example to:

    OptionCaptionML: ENU=Rabbit,Snake;YOULANGUAGECODE=Bunny,Cobra

    Regards
    Do you make it right, it works too!
  • DenSterDenSter Member Posts: 8,304
    pskannaa wrote:
    My customization User wants to show/Display the "Transaction Type" is "Purchase" and it will be Matching the Transaction type while creating "Purchase Order", so that i can match the "document type" of PO Card.

    Like
    If myform.Transaction type = Poheader.Document type Then do statements...
    ..............
    ..............
    I would try and convince the client that this is a bad idea, and to just use the values that are in the application. This kind of stuff is used all over the place, and to add a layer of complexity to your code to translate option values just adds work, and will cost the client more money.
Sign In or Register to comment.