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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Use addOnPostSave event after qualifying Lead

(0) ShareShare
ReportReport
Posted on by 2,102

Hello Everyone !!

I have one requirement that if Lead is getting qualify, need to open it's parent contact form.

For this I am using addOnPostSave event. I have bind this event on load of the form but it is not been called when I am qualifying lead. It is beeing called when I SAVE the lead by pressing OOB save button.

Can someone please confirm if we can use this event after lead qualify OR we can ONLY use it after we are saving the form OOB save button.

Thanks in advance !!

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Inkey Solutions,

    I tested this function. Yes, it is triggered when the record is saved as the doc(docs.microsoft.com/.../addonpostsave) says:

    "Adds an event handler to be called after the record is saved with success or failure.".

    However, it's not only triggered when you click OOB save button. It's also triggered when you use formContext.data.save(). Please see the below code:

    function onLoad(executionContext)
    {
    var formContext = executionContext.getFormContext();
    formContext.data.entity.addOnPostSave(myFunction);
    setTimeout(()=>{

    formContext.getAttribute("jobtitle").setValue(formContext.getAttribute("jobtitle").getValue() + "a");
    formContext.data.save();}
    ,3000)
    }

    function myFunction(){
    alert("1");
    }

    Result:

    pastedimage1639100973032v1.png

    If you enabled auto saved feature, I believe that it could also be triggered when the record is auto saved(I didn't test this).

    So this function can't achieve your requirement. You can try customize Qualify button command with Ribbon Workbench. It should work.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
ManoVerse Profile Picture

ManoVerse 58 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans