BPM Help please

Thanks Kevin and Jose

That sorted it.


I had a feeling it would be something simple, took me a while to come up with the initial code!

Mark

--- In vantage@yahoogroups.com, "Kevin Simon" <ksimon@...> wrote:
>
> Mark,
>
>
>
> Before you access the part data, you need to make sure it's available.
>
>
>
> find first ttorderdtl no-lock no-error.
> if available ttorderdtl then do:
> find first part where part.PartNum = ttorderdtl.PartNum no-lock no-error.
>
> If available part then do:
> if part.Character02 > " " then do:
> {lib/PublishInfoMsg.i &InfoMsg = "part.Character02" }.
> END.
>
> END.
> END.
>
>
>
> Hope that helps,
>
>
>
> Kevin Simon
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> Mark
> Sent: Thursday, February 03, 2011 9:10 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] BPM Help please
>
>
>
>
>
> Hi
>
> I have written a BPM on the SalesOrder.ChangePartNum BO that looks at the
> Part Number entered and if there are comments in the Part.Character02 field
> then it display them as a message in the sales order.
>
> This works great until someone puts in a part number that doesn't exist in
> the part master, instead a warning is displayed and this Appserver Error is
> created. "'ChangePartNumPre31_A1 bo/SalesOrder.p' Line:5801) ** No Part
> record is available. (91)"
>
> What adjustment do I need to make to the code to only let it run when the
> part number exists in the part master.
>
> Code as below:
>
> find first ttorderdtl no-lock no-error.
> if available ttorderdtl then do:
> find first part where part.PartNum = ttorderdtl.PartNum no-lock no-error.
> if part.Character02 > " " then do:
> {lib/PublishInfoMsg.i &InfoMsg = "part.Character02" }.
> END.
> END.
>
> Thanks
>
> Mark
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Hi

I have written a BPM on the SalesOrder.ChangePartNum BO that looks at the Part Number entered and if there are comments in the Part.Character02 field then it display them as a message in the sales order.

This works great until someone puts in a part number that doesn't exist in the part master, instead a warning is displayed and this Appserver Error is created. "'ChangePartNumPre31_A1 bo/SalesOrder.p' Line:5801) ** No Part record is available. (91)"

What adjustment do I need to make to the code to only let it run when the part number exists in the part master.

Code as below:

find first ttorderdtl no-lock no-error.
if available ttorderdtl then do:
find first part where part.PartNum = ttorderdtl.PartNum no-lock no-error.
if part.Character02 > " " then do:
{lib/PublishInfoMsg.i &InfoMsg = "part.Character02" }.
END.
END.

Thanks

Mark
You need another if available then do on the find first part

find first ttorderdtl no-lock no-error.
if available ttorderdtl then do:
find first part where part.PartNum = ttorderdtl.PartNum no-lock no-error.
if available part then do:
if part.Character02 > " " then do:
{lib/PublishInfoMsg.i &InfoMsg = "part.Character02" }.
END.
END.
END.

*Jose C Gomez*
*Software Engineer*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>

*Quis custodiet ipsos custodes?*



On Thu, Feb 3, 2011 at 9:10 AM, Mark <teaglem@...> wrote:

>
>
> Hi
>
> I have written a BPM on the SalesOrder.ChangePartNum BO that looks at the
> Part Number entered and if there are comments in the Part.Character02 field
> then it display them as a message in the sales order.
>
> This works great until someone puts in a part number that doesn't exist in
> the part master, instead a warning is displayed and this Appserver Error is
> created. "'ChangePartNumPre31_A1 bo/SalesOrder.p' Line:5801) ** No Part
> record is available. (91)"
>
> What adjustment do I need to make to the code to only let it run when the
> part number exists in the part master.
>
> Code as below:
>
> find first ttorderdtl no-lock no-error.
> if available ttorderdtl then do:
> find first part where part.PartNum = ttorderdtl.PartNum no-lock no-error.
> if part.Character02 > " " then do:
> {lib/PublishInfoMsg.i &InfoMsg = "part.Character02" }.
> END.
> END.
>
> Thanks
>
> Mark
>
>
>


[Non-text portions of this message have been removed]
Mark,



Before you access the part data, you need to make sure it's available.



find first ttorderdtl no-lock no-error.
if available ttorderdtl then do:
find first part where part.PartNum = ttorderdtl.PartNum no-lock no-error.

If available part then do:
if part.Character02 > " " then do:
{lib/PublishInfoMsg.i &InfoMsg = "part.Character02" }.
END.

END.
END.



Hope that helps,



Kevin Simon



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Mark
Sent: Thursday, February 03, 2011 9:10 AM
To: vantage@yahoogroups.com
Subject: [Vantage] BPM Help please





Hi

I have written a BPM on the SalesOrder.ChangePartNum BO that looks at the
Part Number entered and if there are comments in the Part.Character02 field
then it display them as a message in the sales order.

This works great until someone puts in a part number that doesn't exist in
the part master, instead a warning is displayed and this Appserver Error is
created. "'ChangePartNumPre31_A1 bo/SalesOrder.p' Line:5801) ** No Part
record is available. (91)"

What adjustment do I need to make to the code to only let it run when the
part number exists in the part master.

Code as below:

find first ttorderdtl no-lock no-error.
if available ttorderdtl then do:
find first part where part.PartNum = ttorderdtl.PartNum no-lock no-error.
if part.Character02 > " " then do:
{lib/PublishInfoMsg.i &InfoMsg = "part.Character02" }.
END.
END.

Thanks

Mark





[Non-text portions of this message have been removed]