OrderHed.InvoiceComment to feed through to InvcHead.InvoiceComment

epicor version 9.05.701

Trying to create a BPM to update the invchead.invoicecomment FROM the OrderHed.InvoiceComment every time the latter field updates.
Has anybody done this?
Thanks in advance.

Note, obviously in some cases, there will only be an order as the invoice won’t yet have been produced.

Decided to go down the ABL route but getting this error:

/* invoiceheader comment from salesorder header comments invoice tab data directive */

For each ttOrderHed where ttOrderHed.RowMod = ‘U’.
For each OrderHed fields ( OrderNum ) no-lock where ttOrderHed.Company = InvcHead.Company and ttOrderHed.OrderNum = InvcHead.OrderNum.

If InvcHead.InvoiceNum > ‘20’ Then Do:
/* Go to the sales order header and retrieve the comments in the header comments invoice tab */

Assign ttOrderHed.InvoiceComment = InvcHead.Character01.

End.

End.

must be getting closer?!
also, once the syntax is correct, which table should this sit against in the data directive…orderhed or invchead?

Wouldn’t a BPM on the update method of the Sales Order be appropriate. Something like check if the order is invoiced (has an invoice number), RowMod is U and the Invoice comment has changed from any to any?

Not in front of any systems ATM to look in more detail.

Checkout https://www.epiusers.help/t/bpm-abl-question/45616

Maybe that will help…I’m assuming it will be execute ABL… or perhaps the set the specified file of all rows identified by the designed query

got a bit further with this ABL as it doesn’t error, it validates successfully…however, it doesn’t fire:

FOR EACH ttInvcHead, FIRST OrderHed FIELD(Character01) WHERE OrderHed.Company = ttInvcHead.Company AND OrderHed.OrderNum = ttInvcHead.Ordernum NO-LOCK.
IF orderhed.invoicecomment <> " " THEN DO:
ASSIGN ttInvcHead.Character01 = OrderHed.InvoiceComment.
END.
END.

it seems to work but the refresh time of clicking save on the order is quite a while which concerns me i’ve got something wrong:
re-edited:

FOR EACH InvcHead, EACH OrderHed WHERE OrderHed.Company = InvcHead.Company AND OrderHed.OrderNum = InvcHead.Ordernum AND OrderHed.Company = Cur-comp AND OrderHed.OrderNum = OrderHed.OrderNum NO-LOCK.
IF orderhed.invoicecomment <> " " THEN DO:
ASSIGN InvcHead.Character01 = OrderHed.InvoiceComment.
END.
END.