Forum Discussion

MarkShnier__You's avatar
MarkShnier__You
Qrew #1 Challenger
2 years ago

Create only 1 Parent when Grid Edit children are created

I had an interesting use case where I needed to create a single Parent Parent RMA when child Parts Returned were created on a Service Report.

So
One Service Report has many Parts Returned.
One RMA has many Parts Returned.

The issue I ran into was that Parts Returned are entered in Grid Edit mode as Children to the Service Report.  When I set up the Pipeline I encountered what i believe to be a "race" condition where by multiple Children were creating a an RMA parent.  I have a search step to check for the existence of the correct RMA Parent, but since the children were all created at almost the same time when the grid edit was saved, I was getting duplicate RMA parent created.

My solution was to introduce a random pause step  using the clock channel with a delay of

{{ [0, 1, 2, 3, 4, 5, 6, 7, 8 , 9, 10,11,12,13,14,15,16,17,18,19,20]| random /2}}seconds

This, I believe is causing a delay of between 1 and 10 seconds

This also worked, o probably a better option.  It causes a delay of between 0 and 20 seconds.
{{ range(1, 2000) | random /100}}seconds

Just interested in if anyone else has an idea to how to deal with that race condition when children are being created by Grid Edit and we need one parent created. 

When we had Automations they behaved so as to queue up nicely and run one by one, but Pipeline are more performance oriented so seem run multiple instances concurrently.

------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
No RepliesBe the first to reply