Показать сообщение отдельно
Старый 07.10.2019, 16:47   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1310: Using Flow to test concurrency
Источник: https://crmtipoftheday.com/1310/usin...t-concurrency/
==============

Today’s tip is from Shidin ‘D365fanboi’ Haridas – thank you!

Got a tip of your own? Why won’t you send it to jar@crmtipoftheday.com when you have a minute? Now, over to Shidin.

Most CRM implementations, at some point, would have required to implement a bespoke auto-numbering system.

However, testing the custom built auto-numbering solution end-scenarios, especially involving optimistic concurrency was always the toughest challenge.

Flow can be used to help out testing such end-scenarios of optimistic concurrency:
  1. Create a flow with a loop to create the entity records (in the below example, initialized an array collection to loop through)

  1. In the loop control settings, enable ‘Concurrency Control’ and increase degree of parallelism to 2+.

  1. Now, when the flow executes, multiple records will be created in the Dynamics 365 database at the exact time!!
  2. To verifying this, create an alternate key on the auto-number attribute.
The flow run will fail if the bespoke auto-numbering system tried to insert the same values against the record.

Tîpp Jäår $0.02 + GST
  • It’s been a while since I implemented an auto-numbering system that required testing. Why? Because Common Data Service supports auto-numbering. Having said that, I have seen autonumbering requirements in the wild that wouldn’t fit on one page and require a team of 3 or more software engineers to implement. Those exactly are the occasions where you’d want to test. Or change the requirements. Or job.
  • Don’t restrict your imagination to auto-numbers. There are plenty of other situations where you’d want to test records be created at the same time.
  • Be aware of the Flow limits – those would be very easy to break while doing loop-de-loop.
Cover photo by Pixabay



Источник: https://crmtipoftheday.com/1310/usin...t-concurrency/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.