@Garaudy_Etienne Thank you for your response that was very helpful. Actually I cant really do write operations before querying the right documents first. I guess in that case I am left with no other option then to have a boolean flag for inventory documents and then when the transaction starts, do a write operations and turn the flag to true for all the possible required inventory documents before querying the right inventory documents. Or is there a better solution?