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)

Form Close event in Dynamic CRM

(0) ShareShare
ReportReport
Posted on by

Hi all,

Is there any event in dynamic CRM for identifying form is closed/form is changed/switched to new form ?

Thanks

Arun

*This post is locked for comments

I have the same question (0)
  • Kishor Kumar Profile Picture
    3,710 on at
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello Arun,

    There is no easy way to identify that form is closed. Just curious - why do you need it?

  • Suggested answer
    Community Member Profile Picture
    on at

    We have "getFormType()" method to get the form context of the record.

    Syntax :

    Xrm.Page.ui.getFormType();

    You can refer "msdn.microsoft.com/.../gg327828.aspx;.

  • Community Member Profile Picture
    on at

    I need to update one field in another entity when form is closed/ away from form. As we building Time tracking Project where we have to work with incident. I am creating a new record when we open the incident with start date and want to update the end date time when form is closed/ we leave the form. Do you have any better idea?

  • Suggested answer
    Community Member Profile Picture
    on at

    Can you explain the problem you are facing with an appropriate example ? If possible please provide an example.

    As per my knowledge we cant identify whether the form is being closed or not in CRM. Workaround for this is that you can update the end date time when user hits "save&close" button to close the form.

    getSaveMode(), returns a value indicating how the save event was initiated by the user.

    Below is the sample code :

    function preventAutoSave(econtext) {
        var eventArgs = econtext.getEventArgs();
        if (eventArgs.getSaveMode() == 2 ) //when save&close button is clicked

        {
                //update end date time code here.
        }
    }

     

     

    Please mark it as answered if you find it to be hellpful.

    Thank You.

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