I have a general question around efficiency and best practice.
I have read on the Microsoft forum that I should avoid using ExecuteMultipleRequest in my plugins at all costs however it seems to me that its far less efficient to make say 10 calls when 1 call would do, so far my plugin has been working fine without issue however now I'm attempting another creation I'm hitting issues.
For example i have a plugin that updates the opportunity record with opportunityproduct(s), in this example I'm updating with 10 products,
i use ExecuteMultipleRequest to create the product entities in one transaction,
i use ExecuteMultipleRequest to set the state / status of the product entities (SetStateRequest) in one transaction,
i use ExecuteMultipleRequest to create productpricelevel entities
- so far this process has taken between 3,000 - 3,531 ms
I then use ExecuteMultipleRequest to create the Opportunityproduct entities in one transaction (there are only 10 records to create)
- plugin execution time drastically jumps to 120,036 causing time out error.