Help! BPM to copy comments from Part Master to Quote Line

As written the For each quoteDtl will loop through ALL quote details records in the database regardless of quote and company.  You need to put some filtering on it since you are working with the physical table (quoteDtl) or use the Temporary table (ttQuoteDtl) which will have the record being modified by the method.  Similar issue with PartRev, you need to add partRev.partNum = Part.PartNum.

Since this is a post-processing BPM, if you update the physical table (quoteDtl) you will get a Row has been modified message when you come back to the quote screen.  If you update the temporary table in a post processing BPM you need to save the screen before exiting or the change will rollback.  There are some other approaches when updating in a post-processing that have been discussed in other messages on the group.

I haven't looked at the method you are triggering the BPM but you may want to consider moving this to a pre-processing BPM and only work with the temporary tables.  Changes in the pre-processing stage will not generate a row modified message and the main method will make the changes permanent or at least properly stage them for later saving.

Jim Kinneman
Encompass Solutions, Inc

I have been trying without success to write a bpm.  Any help would be greatly appreciated.

 

My failed code is below, as well as the error message when I try to compile it:

 

BPM objectives:

If I Get Details for a quote line (from an alternate method) then do:

Copy alternate method comments to Quote Comment (i.e. QuoteDtl.QuoteComment = Partrev.RevDescription)

 

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

 

/* QuoteAsm.GetDetails Post-Processing */

For each quotedtl no-lock:

                find first part where part.company = CUR-COMP and part.partnum = quotedtl.PartNum no-lock no-error.

                if available part then do:

                                find first partrev where partrev.company = CUR-COMP and partrev.configured = FALSE and partrev.RevisionNum = QuoteAsm.RevisionNum and Partrev.AltMethod = sourceAltMethod no-lock no-error.

                                if available partrev then do:

                                run lib\updateTableBuffer.p (input buffer Quotedtl:handle,input "QuoteComment",input Partrev.RevDescription).

                                end.

                                end.

                end.

                end.

end.

 

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

 

Error message:

** Cannot find NEXT LEAVE RETRY or UNDO label on appropriate block. (209)

** Coud not understand line 1. (196)

** Unknown Field or Variable name - exceptionOccurred___. (201)

** Could not understand line 1. (196)

 

Thanks,

 

Daniel Nickoley

This email has been filtered by SMX. For more information visit smxemail.com
Hi Dan,

I haven't tried it but you may want to look at this statement again:

   find first partrev where partrev.company = CUR-COMP and partrev.configured = FALSE and partrev.RevisionNum = QuoteAsm.RevisionNum and Partrev.AltMethod = sourceAltMethod no-lock no-error.

You are referencing "QuoteAsm". Did you mean QuoteDtl? or "sourceRev"
Is this Vantage or E9?
Thanks, David.  We are on Vantage 8.03.409A.