Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Need to display default form for an entity

Posted on by

Hi Team,

I have 3 forms for task activity entity, lets say form1, form2, form 3. When i place an activities subgrid on any form and click plus button, i can add new task. All the forms are getting displayed in the form selector.By default , i need only form1 to be opened up. Please suggest.

Currently if i enter data in form2 and save the form, the next time i open task(from subgrid plus button), i was displayed form2 on create page. I need Form1 here by defauly irrespective of previous history

Thanks
Goutham

*This post is locked for comments

  • Suggested answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: Need to display default form for an entity

    Hi

    Why dont you try in form onload

    var formId="Form GUID hard code"

    Xrm.Page.ui.formSelector.items.get(formId).navigate();

    If you want to get form guid for corresponding form

    Xrm.Page.ui.formSelector.getCurrentItem().getId( )

  • Jason M. Cosman Profile Picture
    Jason M. Cosman 5,234 on at
    RE: Need to display default form for an entity

    Hello Goutham;

    I think it's important to understand how CRM works with the forms for this. With CRM whatever form you leave off on in the entity is the form that loads up automatically when you open that entity again. In your case if your creating an entity with Form 2 and then leave and open it after it'll be in form 2. Drew definitely has the right idea in terms of i'd think javascript will be an easy fix for you but you'll have to define how you want that to work. Is it only on update or readonly form state you'd want to default it to form 1? Things like this is what you'll have to consider.

    Hope this helps!

  • Goutham A Profile Picture
    Goutham A on at
    RE: Need to display default form for an entity

    Thanks Drew. That was great to hear and very valuable information.

    But i am queering using javascript and i could not retrieve UserEntityUISettings  from web api. Also tried fetchxml but of no avail(could not see in advanced find). Server side implementation doesn't suit for me.. Need to think of some uncustomised javascript customization.

    Thanks.

  • Verified answer
    Drew Poggemann Profile Picture
    Drew Poggemann 9,079 on at
    RE: Need to display default form for an entity

    Hi Goutham,

    I found the following (very dated) but it might be exactly what is causing your issue here...

    From another post...

    You need to do a little magic trick in CRM to make a form sticky. CRM stores the Most Recently Used (MRU) forms in a special entity called UserEntityUISettings. This entity stores UI settings per entity per user in xml.

    What you need to do is to prevent CRM from changing this entity whenever the user changes the form for a given entity. Basically you want to control the attribute called lastviewedformxml. You can get some inspiration from this blog post: 

    https://community.dynamics.com/crm/b/gonzaloruiz/archive/2014/11/19/avoiding-form-reload-when-switching-crm-forms-based-on-a-field

    Hopefully this helps!

    Thanks,

  • Suggested answer
    Nadeeja Bomiriya Profile Picture
    Nadeeja Bomiriya 6,804 on at
    RE: Need to display default form for an entity

    Hi Goutham,

    You can use JavaScript to change the form to a specific form on OnLoad event.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans