web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Using Flow to update Account From after qualifying lead

(0) ShareShare
ReportReport
Posted on by 390

Hi,

I have a task where the users want to update a bunch of stuff an Account after qualifying a lead. So I generated a Flow where I trigger on "Create" which works fine flow runs as intended. However the complain is now that as the Account for opens automatically when qualifying the lead the updates from Flow are not visible as they are run in the background so the user needs to to a refresh in order to see the changes made by the Flow. 

Any ideas? Should we just tell users, du a refresh of account form to see the update or can this be automated? Or should we go another way?

best regards

Martin

I have the same question (0)
  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi martin,

    I implemented something similar using some JS code to simulate a flow process as a real time process. I will share my code this evening.

    Although I have implemented the solution, I recommend users to use the refresh button while waiting for Microsoft to give the option to use flow in real time mode.

    Have a good day :)

  • icimasa Profile Picture
    390 on at

    Hi Mehdi,

    that would be really interesting if you could share that to see the solution you came up with, looking forward to that. And yes my suggestion would also be to get the users to refresh the page. And there it seems like it would be a nice feature to maybe trigger an Alert banner to advise the user to Refresh due to new updated content if you understand my point.

    best regards

    Martin

  • Verified answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    In my scenario, I have a flow wish is executed when a contact is created. 

    In order to simulate a real time process, I add 3 status reason to the contact entity:

    • In progress: Flow's execution is in progress. 
    • Success: Flow's execution is successful
    • Failure: Flow's execution is failed

    Basically, in my sample code, when a contact is created within the quickCreate I open a ProgressIndicator; and I check recursively the status reason until it's different from In progress value. Then I close the ProgressIndicator. Of course you can also refresh your data if needed. 

    function refrechDataAfterFlowExecution(selectedItems) {
        var entityFormOptions = {};
        entityFormOptions["entityName"] = "contact";
        entityFormOptions["useQuickCreateForm"] = true;
        formParameters = {};
        Xrm.Navigation.openForm(entityFormOptions, formParameters)
            .then(function (success) {
                return contactParam = {
                    logicalName: success.savedEntityReference[0].entityType,
                    Id: success.savedEntityReference[0].id.replace("{", "").replace("}", "")
                };
            })
            .then(function (UpdatePriceParam) {
                logicalName = contactParam.logicalName;
                id = contactParam.Id;
                Xrm.Utility.showProgressIndicator("Performing Custom Operations in Background. Please Wait..")
                const recursiveCall = (status) => {
                    return new Promise((resolve) => {
                        console.log(status);
                        if (status != 177530000) {
                            Xrm.WebApi.retrieveRecord("contact", contactParam.Id, "?$select=statuscode").then(
                                function success(result) {
                                    console.log(result)
                                    status = result.statuscode
                                    return setTimeout(() => resolve(recursiveCall(result.statuscode)), 500);
                                })
    
                        } else {
    
                            return resolve()
                        }
                    })
                }
    
                recursiveCall(0).then(() => Xrm.Utility.closeProgressIndicator());
            })
    }

  • icimasa Profile Picture
    390 on at

    Hi Mehdi,

    thanks for the script, I will try this one. I also wonder if Logical Apps could be a solution if they run realtime?

    best regards

    Martin

  • Suggested answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hi Martin,

    As I know, data moves from the CRM to logic apps asynchronously. Flow is build on top of Logic Apps. I'm afraid that is not possible too.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 60 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans