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)

Formtype Change event

(0) ShareShare
ReportReport
Posted on by

Hello, 

I have a entity which has 2 forms. 

Is there a way to fire an event when user changes the form. Like displaying alert etc..

I want to set some field value when user changes the form manually. 

Regards

Prasad. 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mahadeo Matre Profile Picture
    17,021 on at

    Hi,

    When user manually change form, then Form is loaded again, so you can add logic in form load event, and based on current form you can set values to fields.

    You need to add onload event on both forms.

    you can get current form name/ id using

    var formname =  Xrm.Page.ui.formSelector.getCurrentItem.getLabel();

    var formId =  Xrm.Page.ui.formSelector.getCurrentItem.getId();

    msdn.microsoft.com/.../gg327828.aspx

    msdn.microsoft.com/.../gg309560.aspx

    Another option is even you have 2 forms you can enable security on forms, and based on user role you can show form to user.

    Hope this will help..

  • Suggested answer
    ansrikanth Profile Picture
    3,115 on at

    The form Onload is the only event that can help you on this. If the user changes the form then onload event will fire, The first step you have to do in the onload is, check what is the form name using the formSelector, based on that you can take further required action like setting a field value, showing an alert or even forcing user to shift to another form.. 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

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