Team, I am stumped. I have a working BPM that appears to be working completely, but does not actually create any records.
E9.05.702 (not 702a)
The Order is being created via DMT and the OrderComment field is loaded with text that needs to be split up and made into Header Misc Charges.
I have added messages to the log to ensure everything is working and it appears to be perfect. Butā¦ Nothing. I am testing this by simply changing the text of the Comment.
I have moved things around quite a bit, but I am willing to try anything againā¦
Here is an example of the Comment:
Discount (none) : $0.0 | Shipping : $10.0 | Tax (NY State Tax,Dutchess County Tax 0.04,0.04125) : $2.44
Pre-Processing:
Post-Processing code:
def var orderNum like OrderHed.OrderNum no-undo.
def var custNum like OrderHed.CustNum no-undo.
def var orderComment as char no-undo.
def var logMsg as char no-undo.
def var lContinue as log no-undo.
def var cResponseMsg as char no-undo.
def var cDisplayMsg as char no-undo.
def var cCompliantMsg as char no-undo.
def var cResponseMsgOrdRel as char no-undo.
def var iEntry as int no-undo.
def var sEntry as char no-undo.
def var dAmount as dec no-undo.
def var miscCode as char no-undo.
def var hSO as handle no-undo.
RUN bo\SalesOrder\SalesOrder.p PERSISTENT SET hSO.
for each ttOrderHed:
assign orderNum = ttOrderHed.OrderNum
custNum = ttOrderHed.CustNum
orderComment = ttOrderHed.OrderComment
logMsg = "Shopify Misc (Order: " + STRING(ttOrderHed.OrderNum) + ") ".
end.
message logMsg + "Start".
repeat iEntry = 1 to NUM-ENTRIES(orderComment,'|'):
assign sEntry = TRIM(ENTRY(iEntry, orderComment, '|')).
if sEntry BEGINS "Shipping" then miscCode = "FRT".
if sEntry BEGINS "Tax" then miscCode = "SLTX".
assign dAmount = DECIMAL(ENTRY(2, sEntry, "$")).
if miscCode <> "" and dAmount > 0 and not CAN-FIND(first ttOHOrderMsc where ttOHOrderMsc.MiscCode = miscCode) then do:
message logMsg + "Get Order".
run GetByID in hSO (input orderNum, {&output_dataset_SalesOrderDataSet}).
run GetNewOHOrderMsc in hSO ({&input-output_dataset_SalesOrderDataSet}, orderNum, 0).
message logMsg + miscCode + " Get New".
for first ttOHOrderMsc where ttOHOrderMsc.RowMod = "A".
ttOHOrderMsc.MiscCode = miscCode.
message logMsg + miscCode + " Set Code".
end.
run ChangeMiscCode in hSO ({&input-output_dataset_SalesOrderDataSet}, "OHOrderMsc").
for first ttOHOrderMsc where ttOHOrderMsc.MiscCode = miscCode.
ttOHOrderMsc.Freqcode = "F".
ttOHOrderMsc.DocDspMiscAmt = dAmount.
ttOHOrderMsc.RowMod = "A".
message logMsg + miscCode + " Set Amount: " + STRING(dAmount).
end.
run ChangeMiscAmount in hSO ({&input-output_dataset_SalesOrderDataSet}, "OHOrderMsc").
run MasterUpdate in hSO (input true, input "OHOrderMsc", input custNum, input orderNum, input false, output lContinue, output cResponseMsg, output cDisplayMsg, output cCompliantMsg, output cResponseMsgOrdRel, {&input-output_dataset_SalesOrderDataSet}).
message logMsg + miscCode + " Update Order".
end.
end.
message logMsg + "END".
run GetByID in hSO (input orderNum, {&output_dataset_SalesOrderDataSet}).
Log output:
[20/11/12@18:18:44.767-0800] P-009136 T-002312 2 AS AS -- TRACE: SINGLE-RUN Procedure 'bo/SalesOrder/Sink.p:MasterUpdate' START (14244)
[20/11/12@18:18:44.927-0800] P-009136 T-002312 1 AS BAQ Parameterized execution of '' query on behalf of manager user is started.
[20/11/12@18:18:44.990-0800] P-009136 T-002312 2 AS FILEID Open d:\EpicorData\baq9136203658007.p ID=11
[20/11/12@18:18:44.990-0800] P-009136 T-002312 2 AS FILEID Close d:\EpicorData\baq9136203658007.p ID=11
[20/11/12@18:18:44.991-0800] P-009136 T-002312 2 AS FILEID Open d:\EpicorData\baq9136203658007.p ID=11
[20/11/12@18:18:44.998-0800] P-009136 T-002312 2 AS FILEID Close d:\EpicorData\baq9136203658007.p ID=11
[20/11/12@18:18:44.998-0800] P-009136 T-002312 2 AS FILEID Open d:\EpicorData\baq9136203658007.p ID=11
[20/11/12@18:18:45.006-0800] P-009136 T-002312 2 AS FILEID Close d:\EpicorData\baq9136203658007.p ID=11
[20/11/12@18:18:45.007-0800] P-009136 T-002312 2 AS FILEID Open d:\EpicorData\baq9136203658007.r ID=11
[20/11/12@18:18:45.010-0800] P-009136 T-002312 2 AS FILEID Close d:\EpicorData\baq9136203658007.r ID=11
[20/11/12@18:18:45.011-0800] P-009136 T-002312 2 AS FILEID Open d:\EpicorData\baq9136203658007.r ID=11
[20/11/12@18:18:45.011-0800] P-009136 T-002312 2 AS FILEID Close d:\EpicorData\baq9136203658007.r ID=11
[20/11/12@18:18:45.012-0800] P-009136 T-002312 1 AS BAQ Parameterized execution of the query is finished.
[20/11/12@18:18:45.638-0800] P-009136 T-002312 2 AS FILEID Open d:\Epicor905\bpmExec\LiveBPM\bo\SalesOrder\SalesOrder.r ID=11
[20/11/12@18:18:45.644-0800] P-009136 T-002312 2 AS FILEID Close d:\Epicor905\bpmExec\LiveBPM\bo\SalesOrder\SalesOrder.r ID=11
[20/11/12@18:18:45.681-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14822) Shopify Misc (Order: 1198100) Start
[20/11/12@18:18:45.681-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14833) Shopify Misc (Order: 1198100) Get Order
[20/11/12@18:18:46.340-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14837) Shopify Misc (Order: 1198100) FRT Get New
[20/11/12@18:18:46.340-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14841) Shopify Misc (Order: 1198100) FRT Set Code
[20/11/12@18:18:46.404-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14849) Shopify Misc (Order: 1198100) FRT Set Amount: 10
[20/11/12@18:18:46.728-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14854) Shopify Misc (Order: 1198100) FRT Update Order
[20/11/12@18:18:46.729-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14833) Shopify Misc (Order: 1198100) Get Order
[20/11/12@18:18:47.775-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14837) Shopify Misc (Order: 1198100) SLTX Get New
[20/11/12@18:18:47.775-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14841) Shopify Misc (Order: 1198100) SLTX Set Code
[20/11/12@18:18:47.838-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14849) Shopify Misc (Order: 1198100) SLTX Set Amount: 2.44
[20/11/12@18:18:48.415-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14854) Shopify Misc (Order: 1198100) SLTX Update Order
[20/11/12@18:18:48.416-0800] P-009136 T-002312 1 AS -- (Procedure: 'UpdatePost42_A1 bo/SalesOrder/SalesOrder.p' Line:14857) Shopify Misc (Order: 1198100) END
[20/11/12@18:18:49.980-0800] P-009136 T-002312 3 AS AS -- TRACE: SINGLE-RUN Procedure END SUCCESS. (14265)