2 Replies Latest reply on Mar 9, 2012 1:29 PM by DanielTurner

    Set Value of Field triggered by value of another field



      Set Value of Field triggered by value of another field


      I'd like to create a script that is triggered by the value of another field.  Once a user selects  a certain value from a drop-down list, I'd like another field's value to be set to the value of yet another field.

      Basically, I have a field that has data entered from an import indicating who this element of production is assigned to...call it AssignedUser.  I have another field for the Status that is a drop down menu.  Once they select "Complete" from the Status dropdown, I'd like another field, call it CompletedBy to then be populated with the value from the AssignedUser. 

      Any insight would be greatly appreciated.


        • 1. Re: Set Value of Field triggered by value of another field

          You could use the OnObjectExit or OnObjectSave trigger to perform a script for this, but if the only thing you need to do is enter data into another field, you don't need to.

          Open Manage | Database | Fields and find the CompletedBy field. Double click it to open Field Options.

          Select the auto-enter tab. Enter a calculation such as:

          If ( Status = "Complete" ; AssignedUser ; self )

          Depending on how this field is used, you can clear the " do not replace existing value" check box if you want this expression to overwrite existing data in the field.

          You can also define CompletedBy as a calcualtion field with this expression: If ( Status = "Complete" ; AssignedUser )

          Or you can place the AssignedUser Field on your layout where you were going to put the CompletedBy field and use conditional formatting to hide the text in the field unless YourTable::Status = "Complete".