1
votes

I want to know if its possible in Dynamics to stop it from saving the last form you were in? For example, I go to the main form of an entity, then go to the second form and Dynamics saves that I was last in the second form. I don't want it to do that - so that when i open a record i'll be navigated to the main form and not the second form. So Dynamics' default behaviour is to save the last form you were in - I want to prevent it from doing that. I appreciate this is the way that Dynamics works but wanted to know if anybody has found any good workarounds. Thanks :)

2
Were you able to solve your problem?Arun Vinoth - MVP
Hi, thanks for the reply! Nope not completely - we cant navigate form because when the user creates a new form - they click the plus button on the subgrid which autofills a few values - so we can detect when they're in the wrong form, but cant seem to pass the values over to the form when we change them from the wrong form to the right form.Will
Can you save & navigate ? Are you talking about this one? stackoverflow.com/questions/46833707/…Arun Vinoth - MVP

2 Answers

0
votes

You could try to use the function Xrm.Page.ui.formSelector; OnLoad to dynamically set the form every time you load a record from the entity.

0
votes

This user preference is stored for each Session by CRM in browser LocalStorageCache itself. Unfortunately this cannot be turned off by any User settings or System settings.

Read more

Use this snippet to navigate back to default Form that you want.

var form = Xrm.Page.ui.formSelector.getCurrentItem();

    if (form != null) {
        var formId = form.getId();
        var formLabel = form.getLabel();
    }

var items = Xrm.Page.ui.formSelector.items.get();
        for (var i in items) {
            var form = items[i];
            var formId = form.getId();
            var formLabel = form.getLabel();
            if (formLabel == "Required Form Name") {
                form.navigate();
                return;
            }
        }