web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Select Default Form Using Workflow

(0) ShareShare
ReportReport
Posted on by 1,799

Hi,

I was having a think about the best way to achieve separating customers and suppliers within CRM without doing any development.

-

There would be the option of creating a custom entity, but what about just having an option-set on the account form that listed "account" & "supplier"

-

Then you would easily be able to create views to filter accounts and suppliers individually.

-

Finally could you not set up a workflow that specifies the form that is shown by default on the account page by referring to what is populated in the option-set? So if the new option-set was populated by supplier, the default form for the account would be the supplier form?

-

I'm not entirely sure if the workflow is achievable.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    ScottDurow Profile Picture
    21 on at
    RE: Select Default Form Using Workflow

    Using separate forms for different record types really doesn't work very well due to the dual form submit on load. It is better to define the fields that are shown or hidden based on the optionset - www.powerobjects.com/.../show-hide-field-dynamics-crm-2013-portable-business-logic

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Select Default Form Using Workflow

    You are just mentioning of creating of option set only, in case you are just using option set to differ customer type and handling fields show/hide through business rules or js code, you should be good.

    But if you have plan to setup multiple forms, the you need to write script or plugin as suggested, because CRM remember last visited form and will redirect you by default in the same.

    Thanks

  • Suggested answer
    Royal King Profile Picture
    27,686 on at
    RE: Select Default Form Using Workflow

    I dont think there is a way to do this without any coding.You have to use either script or plugin

    here is the script that can change form type based on value

    function showForm() {

    //if the form is update form

    if (Xrm.Page.ui.getFormType()==2)

       // variable to store the name of the form

       var lblForm;

       // get the value picklist field

       var relType = Xrm.Page.getAttribute("customertypecode").getValue();

       // switch statement to assign the form to the picklist value

       //change the switch statement based on the forms numbers and picklist values

       switch (relType) {

           case 1:

               lblForm = "Information1";

               break;

           case 2:

               lblForm = "Information2";

               break;

           default:

               lblForm = "Information";

       }

       //check if the current form is form need to be displayed based on the value

       if (Xrm.Page.ui.formSelector.getCurrentItem().getLabel() != lblForm) {

           var items = Xrm.Page.ui.formSelector.items.get();

           for (var i in items) {

               var item = items[i];

               var itemId = item.getId();

               var itemLabel = item.getLabel()

               if (itemLabel == lblForm) {

                   //navigate to the form

                   item.navigate();

               } //endif

           } //end for

       } //endif

    }//endif

    } //end function

    Plugin to change formtype based on field value

    gonzaloruizcrm.blogspot.com/.../avoiding-form-reload-when-switching-crm.html

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans