Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Tell if a user clicks "Finish"

Posted on by Microsoft Employee

Hello, I have been trying to get a custom field to update when the User clicks "Finish" on the Business Process Flow. 

I attempted using a plugin to update but I cant seem to grab the Opportunity entity with the plugin as it only fires when I have the steps fire on the actual bpf instance. Because the bpf instance is a linked table Im not able to do a query with Retrieve Multiple to pull up the Opportunity ID.

As far as I can tell no field is updated when "Finish" is clicked so I'm not able to have anything fire based on an update field.

Ive been trying to get it to work with Javascript and I am able to get it to execute when the button is pushed using addOnProcessStatusChange() and using an IF statement to check if the status is "finished" but because of save/load events going on in the form it dosnt save the field I update via code.

If I add the Xrm.Page.data.entity.save() to the function after the field is updated then it has a dialog pop up asking if you want to save changes before loading the form which isn't a very good UI experience.

Ive add a function to the "OnSave" event but because this event fires before anything else I'm unable to change the field being the ProcessStatusChange returns "active" rather than "finished". So I have no way to tell if the User is in the correct spot to update the field.

Is there a way I can tell what button is pushed? Or a way to tell if a process is archived? The StateCode field only allows "Open","Lost" or "Won" so Im unable to go off of that being it is neither Won or Lost yet. The StatusCode shows "In Progress" even after clicking Finish until it is closed as Lost or Won so Im unable to go off of that aswell. 

How do you work with this button?

8512.finishbutton.PNG

*This post is locked for comments

  • Suggested answer
    Ivan Burda Profile Picture
    Ivan Burda 115 on at
    RE: Tell if a user clicks "Finish"

    Hi Scleveland,

    you can refer to this link:

    stackoverflow.com/.../how-to-get-process-finish-button-event-in-dynamics-crm

    Hope this helps

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans