2 Replies Latest reply on Feb 15, 2009 4:59 PM by mayor

    Auto deduct when the status is canceled.

    mayor

      Title

      Auto deduct when the status is canceled.

      Post

      Hello,

       

      I got I table as below;

       

      vot21(po_no, status, po_amount, po_total, po_cancel_total)

       

      The scenario: I want the system to deduct the amount (po_amount for that particular user) automatically when the status is canceled. 

       

      example:

       

      po_no      status       po_amount

      123          accept        100

      456          accept          50

      789          cancel         200

       

      po_total = 150

      po_cancel_total = 200

       

      What we need to do is just change the status from "accept" to "cancel" and the system will calculate the value automatically.

       

      Please advice me.

       

      TQ

       

       

        • 1. Re: Auto deduct when the status is canceled.
          ninja
            

          howdy Mayor,

          Thanks for the post.

           

          You can create two new TO's and link them in by both po_no AND po_status.  One TO would link by po_no AND link po_status to a global field that is always "accept" while the second TO would link to po_no and a second global field that always has "cancel".

             In this way, you can portal the "accepts" in and do a

          po_total=Sum(vot21accept:: po_amount) and a separate

          po_cancel_total = Sum(vot21cancel:: po_amount)

           

          This would update automatically by linking or unlinking the records from the Table Occurrences.

           

          Is this what you are looking for?

          • 2. Re: Auto deduct when the status is canceled.
            mayor
               Yup, I got it, TQ