Показать сообщение отдельно
Старый 30.06.2020, 07:17   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1372: Synchronous Power Automate Flow on create/update of a record
Источник: https://crmtipoftheday.com/1372/sync...te-of-a-record
==============

Today’s tip is indirectly from Alex Shlega. Alex is very thorough in his writing so I was a bit surprised that his answer to running a synchronous flow from a webhook was a ‘no’. The reason cited was that
CDS “execution pipeline” won’t wait for the Flow completion.

Well, it will indeed not, but only because we need tell it that we are going to return something. The moment you add a Response action, the webhook becomes synchronous.

There is a catch, of course. If you update the same record in your flow, you will enter a loop. And you will enter it from a separate process whilst blocking your original request. It means you can’t break that loop if you update the same record. The original update waits for the flow to complete but the flow can’t complete because it waits for the original update to release the record so that the flow can update it. Which is a classic deadlock.

In short, if you update the same record then no matter what you do, the original update will fail.

However, if you update does not touch the same record or entity then it will work. To illustrate, I added a calculated field to the account entity that displays main telephone of the primary contact. Registered the flow as a webhook and included pre-image with the primarycontactid:


Inside the flow I update the primary contact record with the +1 :


The end result? Primary contact record is updated very much synchronously:

Synchronous update of the primary contactIs synchronous flow possible? Yes, it is. Is a good idea? With the deadlock and infinite loop on the cards, it is probably not.

Cover photo: Waiting for Godot, text by Samuel Beckett, staging by Otomar Krejca. Avignon Festival, 1978. Rufus (Estragon) and Georges Wilson (Vladimir) / photographs by Fernand Michaud / CC0



Источник: https://crmtipoftheday.com/1372/sync...te-of-a-record
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.