BPM to update field

I am trying to write a BPM to update the PartMtl.Character01 field with the Part Description relevant to the PartMtl.MtlPartNum and have the following code (I will remove all the log messages when I have it working). The messages are appearing in the log file but the field is not being updated. Am I missing something really obvious? Thank you.

Message “BPM Running - Change Part Description”.
Message "BPM Running - Change Part Description - Part Number: " + String(ttPart.PartNum).

Find First ttPart Where ttPart.RowMod <> “” no-lock no-error.

If Available ttPart Then DO:
Message "BPM Running - Change Part Description - Part Number \ Description: " + String(ttPart.PartNum) + " \ " + String(ttPart.PartDescription).

For Each PartMtl Where PartMtl.Company = ttPart.Company and PartMtl.MtlPartNum = ttPart.PartNum :
Message "BPM Running - Change Part Description - Parent Part Number:  " + String(PartMtl.PartNum).
run lib\updatetablebuffer.p(input BUFFER PartMtl:HANDLE, 'Character01', ttPart.PartDescription).

END.

END.

Do the messages in the FOR EACH loop appears in the log?

If so, add a second message in that loop to log: PartMtl.MtlSeq, PartMtl.MtlPartNum, and PartMtl.Character01, to see what’s already there.

Then copy that new 2nd message and place it after the updatetablebuffer line, to see what the table has after the update.

Hi Calvin

Thanks for your suggestion. It made me realise the part I was looking at was used in some revisions which were unapproved which was why they weren’t showing in the BAQ I was using to check… at least I can confirm the BPM does work!

1 Like