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 :
Microsoft Dynamics CRM (Archived)

Trigger event of form close CRM 2016 Online

(0) ShareShare
ReportReport
Posted on by

Hi Team,

Is there any way I can trigger a javascript on close of a form. My requirement is that when user closes phone call record, i need to save the time in an attribute on form.

How do I track form close event in CRM?

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    SrinivasCh Profile Picture
    572 on at

    Hi Meet,

    There are different places where we need to handle close of form event as per your case.

    1. window close (x button on form).

    i hope you don't want to save time in this case. if you want to save, you can handle this event by using window.onbeforeunload event.

    Refer www.w3schools.com/.../ev_onbeforeunload.asp

    2. Other places are Save& close and "Mark As complete".

    Both has to be handled by hooking onsave method of form with your custom function.

    you have to get the savemode() and handle the savemode()

    Refer msdn.microsoft.com/.../gg509060.aspx

    Hope this helps!!

    Srini Ch

    Mark As Answer ,if you get answer of your question :)

  • SrinivasCh Profile Picture
    572 on at

    Hi Meet,

    is the issue resolved?. Do you need any information?

    Srini

  • Community Member Profile Picture
    on at

    Hi Srini, Thanks for your response. I am still checking it.

    Thanks again!

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Meet,

    Us the below function for the same in your jaavscript code :

    window.onbeforeunload = function() {

          // Add your code here

          alert("Unload event.. Do something...");

    }

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans