CREATE WITH messes up related column sometimes

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BLOMASKY
Posts: 1470
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

CREATE WITH messes up related column sometimes

Post by BLOMASKY »

In my process I have 2 lines:

1st:
FIND QuoteServiceCharges WHERE QuoteServiceCharges IN Quotes.om_QuoteServiceCharges

2nd:
IF SEARCH_COUNT > 0 THEN

Orders.contractorFlag='Yes'
Orders.ob_Customers =QuoteServiceCharges.ps_Contractor.ps_Customers


CREATE OrderLineServiceCharges FOR EACH QuoteServiceCharges

WITH
OrderLineServiceCharges.ob_OrderLines = OrderLines,
OrderLineServiceCharges.description = QuoteServiceCharges.description,
OrderLineServiceCharges.price = QuoteServiceCharges.price,
OrderLineServiceCharges.cost = QuoteServiceCharges.cost,
OrderLineServiceCharges.priceMode=QuoteServiceCharges.priceMode,
OrderLineServiceCharges.ps_Contractor=QuoteServiceCharges.ps_Contractor,
OrderLineServiceCharges.sequenceNumber=QuoteServiceCharges.sequenceNumber



This should have created records in the OrderLineServiceCharges that matched the QuoteServiceCharges. In one test when I had 3 records in the QSC BO, one of them had the wrong ps_contractor. This was easy to duplicate (and I spent an hour with Jaymer trying to debug this. The source BO had contractor 1, 2, 2 in the 3 rows. The output table had 1, 2, 1 as the contractor.

I tried to fix this by moving the 2nd line to a new process and removing the WITH ... and I still got the error. I finally got it to work by also adding IN BATCHES OF 1 to the 1st query.

This seems like a bug to me unless somone can tell me what is wrong with my code.

Bruce
Post Reply