I have a BPM that is sort of working. I added the BOLD.
When an order line is entered and the Plant is not GDL and the ReqDate is > 30 days, it will give a pop.
I cant get the Plant and Date to update, I was able to get the ShipViaCode to update.
DEFINE VARIABLE BPMMessage AS CHARACTER INIT ‘’ NO-UNDO.
FOR FIRST ttOrderRel
WHERE ttOrderRel.Company = cur-comp AND ttOrderRel.RowMod = ‘A’
NO-LOCK:
IF (ttOrderRel.ReqDate > ADD-INTERVAL(TODAY, 30, “days”) AND ttOrderRel.Plant <> ‘GDL’) THEN DO:
{lib/findtbl.i &QFind = first
&QLock = no-lock
&QTableName = UD28
&QWhere = “UD28.Company = CUR-COMP AND UD28.Key1 = ttOrderRel.PartNum”}
IF AVAIL(UD28) THEN DO:
ASSIGN BPMMessage = “Order was changed to GDL, this assembly is approved to be built at that site.”.
ASSIGN ttOrderRel.Plant = “GDL”.
ASSIGN ttOrderRel.ReqDate = ADD-INTERVAL(ttOrderRel.ReqDate, 7, “days”).
ASSIGN ttOrderRel.ShipViaCode = “UPS7”.
{lib/PublishInfoMsg.i &InfoMsg = BPMMessage}.
validate ttOrderRel.
END.
END.
END.