Thanks Bill! I will give this a shot and see where it gets me.
Â
Dustin Biniek
________________________________
From: Bill Jackson <fujijapman@...>
To: vantage@yahoogroups.com
Sent: Wednesday, July 15, 2009 2:05:03 PM
Subject: Re: [Vantage] 4GL BPM Coding Question
pseudo-code follows your code- I'd try something like this:
Â
Â
for each ttPOHeader
Where ttPOHeader.RowMod = 'U' ,
 each PODetail Where PODetail.PONUM = ttPOHeader.PONum and PODetail..UnitCost *  PODetail.OrderQty > 1500
Â
    define variable decMiscTotal as decimal.
    define variable blnNeedEmail as logical.
Â
    If Available PODetail then
Â
      FOR EACH ttPOMisc where POMisc.PONUM = PODetail.PONUM AND POMisc.POLine = PODetail.POLine
     Â
         decMiscTotal = decMiscTotal + POMisc.MscCharge.
Â
      Next ttPOMisc.
      Â
      If ( ( PODetail.UnitCost * PODetail.OrderQty) + decMiscTotal) > 1500 Then
    Â
            blnNeedEmail = True.
Next PODetail.
Â
Â
    /* then use the blnNeedEmail = True to trigger your email */
Â
   /* Inner loop thru POMisc for each PODetail */
Â
Dustin Biniek
________________________________
From: Bill Jackson <fujijapman@...>
To: vantage@yahoogroups.com
Sent: Wednesday, July 15, 2009 2:05:03 PM
Subject: Re: [Vantage] 4GL BPM Coding Question
pseudo-code follows your code- I'd try something like this:
Â
Â
for each ttPOHeader
Where ttPOHeader.RowMod = 'U' ,
 each PODetail Where PODetail.PONUM = ttPOHeader.PONum and PODetail..UnitCost *  PODetail.OrderQty > 1500
Â
    define variable decMiscTotal as decimal.
    define variable blnNeedEmail as logical.
Â
    If Available PODetail then
Â
      FOR EACH ttPOMisc where POMisc.PONUM = PODetail.PONUM AND POMisc.POLine = PODetail.POLine
     Â
         decMiscTotal = decMiscTotal + POMisc.MscCharge.
Â
      Next ttPOMisc.
      Â
      If ( ( PODetail.UnitCost * PODetail.OrderQty) + decMiscTotal) > 1500 Then
    Â
            blnNeedEmail = True.
Next PODetail.
Â
Â
    /* then use the blnNeedEmail = True to trigger your email */
Â
   /* Inner loop thru POMisc for each PODetail */
--- On Wed, 7/15/09, melissa hietala <kevmel822@yahoo. com> wrote:
From: melissa hietala <kevmel822@yahoo. com>
Subject: [Vantage] 4GL BPM Coding Question
To: vantage@yahoogroups .com
Date: Wednesday, July 15, 2009, 2:08 PM
Hi all,
I am attempting to develop a BPM on the "PO" business object. Ultimately I am hoping to create a BPM that will send out an email when a PO is changed from unapproved to approved AND there is at least one line in the PO with a total Price of over $1500. I am using the code below in the "Number of rows in the designed query is not less than 1" condition. At first this seems to be working as I had hoped, but I also need to add in any Misc Costs for the PO Line into the equation to get the "real" total cost of the line. Its starting to get messy because a PO Line can have multiple Misc Costs. So I need to find a way to loop through any Misc lines and then total up the Misc Costs for a line, add that to the UnitCost * OrderQty for the line, and then if that total is greater than 1500 have the email get triggered. Any thoughts on how I can expand the formula below? Or is there another route I should be taking here?Â
Thank you,
Dustin BiniekÂ
for each ttPOHeader
Where ttPOHeader.RowMod = 'U' ,
each PODetail Where PODetail.PONUM = ttPOHeader.PONum and PODetail.UnitCost * PODetail.OrderQty > 1500
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]