AnsweredAssumed Answered

Script to check field data entered

Question asked by BryanN on Nov 21, 2012
Latest reply on Nov 21, 2012 by BryanN

Title

Script to check field data entered

Post

     So I'm trying to add a feature in which a script(s) checks a field in my Work Order table when it is modified (it's a value list pop up) and if it's status is changed to Closed, it will verify that all the related Purchase Orders status' in another table are closed as well. Right now, it's not working and it's letting me close jobs that have open POs.  Trying to find where I am going wrong.  Here's what I have so far:

     Using the script trigger OnModify for the field, the first script runs:

     If [Work_Orders::WO_Status = "Closed"]

        Perform script ["Check_POStatus_for_WOClose"]

     Else

       Commit records

     End If

      

     The second script (Check_POStatus_for_WOClose) is like this:

     If [Purcahse_Orders::PO_Status = "Closed"]

        Commit records

     Else

       Show custom dialog (explaining the error)

       Revert record/request

     End If

Outcomes