PO BPM using ASSIGN

You'll want to make sure that the conditions for your 4GL action make sense. I've created BPMs that will generate application errors when you say delete a record because the 4GL action assumes that ttPODetail is available, or whatever.

So either add an "if available ttPODetail then do:" clause, or make sure that the conditions of your BPM make sense for the action (e.g. "there is at least one updated row" or "there is at least one added row", etc.)
-bws

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of bobschnable
Sent: Wednesday, February 24, 2010 12:08 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: PO BPM using ASSIGN

Got it! I was apparently thinking too hard about it, as I just modified my code to say:
for each ttPODetail:
DO:
Assign.....

And that was it. Thanks for anyone who started looking at this.

--- In vantage@yahoogroups.com, "Bob Schnable" <bschnable@...> wrote:
>
> Hello everyone,
>
>
>
> I am trying to write a BPM that will assign PO.Number01 the value in
> PODtl.UnitCost. My following code, as a pre-process works when you add a
> second, third, fourth etc line to a PO. But when I add the first line,
> which in many cases for us is the only line, it will not populate
> Number01. I tried adding it as a post-process, and it populates the
> field, but won't save. On refresh, it sets it back to zero. I am at a
> loss for why I can't get it to click on the first Line add.
>
>
>
>
>
> find first company no-lock no-error.
>
> for each ttPODetail:
>
> find first PODetail where ttpodetail.ponum = podetail.ponum and
> ttpodetail.ordernum = podetail.ordernum no-lock.
>
> find first porel where podetail.ponum = porel.ponum and podetail.poline
> = porel.poline no-lock.
>
>
>
> /*if ttporel.trantype = "PUR-SUB" or ttporel.TranType = "PUR-MTL" then*/
>
> do:
>
>
>
> /*Message ttPOdetail.Number01 View-As Alert-Box.*/
>
>
>
> /*Run lib\UpdateTableBuffer.p(input BUFFER
> ttPODetail:HANDLE,'Number01','10').*/
>
>
>
> ttPODetail.Number01 = ttpodetail.UnitCost.
>
>
>
> end.
>
> end.
>
>
>
>
>
>
>
> Thanks in advance.
>
>
>
> Robert Schnable
>
> IT Applications and Business Support Associate
>
>
>
> 440-543-8157
>
> 440-543-4582 Fax
>
>
>
>
>
> [Non-text portions of this message have been removed]
>




------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
Hello everyone,



I am trying to write a BPM that will assign PO.Number01 the value in
PODtl.UnitCost. My following code, as a pre-process works when you add a
second, third, fourth etc line to a PO. But when I add the first line,
which in many cases for us is the only line, it will not populate
Number01. I tried adding it as a post-process, and it populates the
field, but won't save. On refresh, it sets it back to zero. I am at a
loss for why I can't get it to click on the first Line add.





find first company no-lock no-error.

for each ttPODetail:

find first PODetail where ttpodetail.ponum = podetail.ponum and
ttpodetail.ordernum = podetail.ordernum no-lock.

find first porel where podetail.ponum = porel.ponum and podetail.poline
= porel.poline no-lock.



/*if ttporel.trantype = "PUR-SUB" or ttporel.TranType = "PUR-MTL" then*/

do:



/*Message ttPOdetail.Number01 View-As Alert-Box.*/



/*Run lib\UpdateTableBuffer.p(input BUFFER
ttPODetail:HANDLE,'Number01','10').*/



ttPODetail.Number01 = ttpodetail.UnitCost.



end.

end.







Thanks in advance.



Robert Schnable

IT Applications and Business Support Associate



440-543-8157

440-543-4582 Fax





[Non-text portions of this message have been removed]
Got it! I was apparently thinking too hard about it, as I just modified my code to say:
for each ttPODetail:
DO:
Assign.....

And that was it. Thanks for anyone who started looking at this.

--- In vantage@yahoogroups.com, "Bob Schnable" <bschnable@...> wrote:
>
> Hello everyone,
>
>
>
> I am trying to write a BPM that will assign PO.Number01 the value in
> PODtl.UnitCost. My following code, as a pre-process works when you add a
> second, third, fourth etc line to a PO. But when I add the first line,
> which in many cases for us is the only line, it will not populate
> Number01. I tried adding it as a post-process, and it populates the
> field, but won't save. On refresh, it sets it back to zero. I am at a
> loss for why I can't get it to click on the first Line add.
>
>
>
>
>
> find first company no-lock no-error.
>
> for each ttPODetail:
>
> find first PODetail where ttpodetail.ponum = podetail.ponum and
> ttpodetail.ordernum = podetail.ordernum no-lock.
>
> find first porel where podetail.ponum = porel.ponum and podetail.poline
> = porel.poline no-lock.
>
>
>
> /*if ttporel.trantype = "PUR-SUB" or ttporel.TranType = "PUR-MTL" then*/
>
> do:
>
>
>
> /*Message ttPOdetail.Number01 View-As Alert-Box.*/
>
>
>
> /*Run lib\UpdateTableBuffer.p(input BUFFER
> ttPODetail:HANDLE,'Number01','10').*/
>
>
>
> ttPODetail.Number01 = ttpodetail.UnitCost.
>
>
>
> end.
>
> end.
>
>
>
>
>
>
>
> Thanks in advance.
>
>
>
> Robert Schnable
>
> IT Applications and Business Support Associate
>
>
>
> 440-543-8157
>
> 440-543-4582 Fax
>
>
>
>
>
> [Non-text portions of this message have been removed]
>