2 Replies Latest reply on Jul 3, 2015 7:07 AM by philmodjunk

    How to move a value from one field to another based on a dropdown list

    PhilipPintoDuran

      Title

      How to move a value from one field to another based on a dropdown list

      Post

      Hello ,  i am developing a sales system for a company , and they have 3 types of payment CHECK, CREDIT, CASH, , so what i want to do is to insert this values in a dropdown list, so if they choose CASH, to move the value of the total to the field CASH, or if they choose credit it moves the value of the total to the credit field.

      Can any one help me?

      attached is the screenshot

       

      Thanks

      Screen_Shot_2015-07-02_at_8.17.08_PM.png

        • 1. Re: How to move a value from one field to another based on a dropdown list
          MaxEh

          There are many ways to approach this depending on what you are trying to accomplish. My initial impression based on the information provided is the following [I am also assuming you have some scripting knowledge (assuming is a bad thing!)]:

          First create a script that determines what the payment type is and then sets the correct field to the value found in Total: (in your example 200).

          Case (

          YourDropDownFieldName = "CREDIT"; Set Field (YourCREDITFieldName; YourTotalFieldName);

          YourDropDownFieldName= "CASH"; Set Field (YourCASHFieldName; YourTotalFieldName);

          YourDropDownFieldName= "CHECK"; Set Field (YourCHECKFieldName; YourTotalFieldName);

          "") 

          Set a script to trigger whenever YourDropDownFieldName is modified. In Layout Mode click on the YourDropDownFieldName then from the menu bar Format: Set Script Triggers: OnObjectModify and select the script you created above. This process will just copy it the appropriate field.

          If you really want to move the Total you could then adjust the script to blank the YourTotalFieldName by Set Field (YourTotalFieldName,""). But since we don't have context, the latter may not be a good idea.

          • 2. Re: How to move a value from one field to another based on a dropdown list
            philmodjunk

            These three fields could also be calculation fields that use a case or If function to either be empty or repeat the value from Total depending on the value selected in the field with the value list.