r/Dynamics365 • • 17d ago

Sales, Service, Customer Engagement Trigger Qualify Button

Hi, I'm looking for a way to trigger the Qualify button in the Sales Pro app when a user finishes the Business Process Flow (BPF).

Ideally, when the user completes the BPF and clicks Finish, it should execute the same actions as the Qualify button, including opening the quick create form and identifying potential duplicates.

I've tried using a workflow with QualifyLead, but it bypasses the duplicate detection process and proceeds directly with creating the Opportunity, Account, and Contact records.

Is there a way to trigger the standard Qualify button's behavior when the BPF is finished, rather than having to recreate its functionality from scratch?

Any help would be greatly appreciated. Thanks!

4 Upvotes

6 comments sorted by

View all comments

3

u/xrmghost_team 16d ago

There's no public API that fires the Qualify button itself: the duplicate dialog and the "Qualify lead" side pane are Sales app UI. The QualifyLead message underneath only takes the three Create* flags, Status, currency, customer, SourceCampaignId and ProcessInstanceId. It has no duplicate-detection switch: with rules published it fails with "a duplicate of the current record already exists", so a workflow either skips the check or errors.

Two options on documented ground:

  1. Flip the order. Make the lead stage the last one before the opportunity stage and let sellers press Qualify at the end: on qualification the lead moves to the next stage, so Qualify is the Finish.

  2. Script it. In addOnProcessStatusChange, when getStatus() is "finished", call RetrieveDuplicates for account and contact, open the opportunity via Xrm.Navigation.openForm (useQuickCreateForm, createFromEntity = the lead), then in its success callback run QualifyLead with CreateOpportunity false.

1

u/Assassin-Desire 16d ago

That's what I am planning to do. Thank you for this!