Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Prevent Dynamics from using last viewed form

Posted on by Microsoft Employee

I have 4 different forms in Account entity.  Based on the form one field gets updated. Nevertheless every time that I open an existing record that was created using certain form it opens the record based on my last viewed form. 

Example :

I create Company "Blue" using form A and I save my record.

Then I create company "Green" using form B and I save the record. 

If I go back to the first company it gets opened but it shows form B instead of form A 

And this is my function to default a field value based on the form...... 

function changeFormLoad() {
var formType = Xrm.Page.ui.getFormType();
var formItem = Xrm.Page.ui.formSelector.getCurrentItem();
var formLabel2 = Xrm.Page.ui.formSelector.getCurrentItem().getLabel();
var companyClassification = Xrm.Page.getAttribute("randgrp_changingformname");
if (formType == 1) {
switch (formLabel2) {
case "Form_test_one":
var field = Xrm.Page.getAttribute("randgrp_changingformname").setValue("Es la forma1");
break;
case "Test_form_two":
Xrm.Page.getAttribute("randgrp_changingformname").setValue("Es la forma2");
break;
case "Test_form_three":
Xrm.Page.getAttribute("randgrp_changingformname").setValue("Es la forma3");
break;
default:
alert("test");
}
}
}

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Prevent Dynamics from using last viewed form

    Hi,

    As I know, "Last viewed form" should only persist during a session. At next logon you should get the first listed form that you have access to through your roles.

    Have you tried signing out, closing all browser windows and signing back in?

    BR,

    Judy

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Prevent Dynamics from using last viewed form

    Hi Judy, yes but if my last viewed form was form C and I open a record I created using form A it will open that record in form C (because it was my last viewed form)

  • RE: Prevent Dynamics from using last viewed form

    Hi,

    My first question is: Why do you have different forms? Would this be for different teams/BU?

    If so, you can add security to for instance show form A to team A and form B to team B.

    As an administrator you will use all forms of course and be aware of which form is showing at that moment. Funny though because usually it remembers the last used form.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Prevent Dynamics from using last viewed form

    Hi,

    Is the form A default form for Account entity?

    BR,

    Judy

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Prevent Dynamics from using last viewed form

    Hi Atapia,

    I don't think you can control this behaviour. This is the default behaviour.

    You could however add a javascript to load the form based on some field values.

    Take a look here-

    community.dynamics.com/.../226961

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans