locked
CRM 2013 - Switching CRM Forms Programmatically RRS feed

  • Question

  • Hi I have a specific business functionality in CRM 2011 which I am trying to migrate into CRM 2013.

    Current Scenario:
    I have a 3 LOB (line-of-business) forms for Opportunity Entity and a Select LOB form.

    1. When user is creating a new Opportunity by clicking on the New button, the default Opportunity form opens.
    2. On Opportunity form load, we have a logic which checks if it is a CreateForm operation, the screen is reloaded with the Select BU form first.
    3. User makes a LOB selection, then we reload the appropriate LOB form for the user based on the selection made and lock down the FormType selection for the user.

    We stored the LOB Form guid on the BusinessUnit entity, so when the user selects the BU, we retrieve the appropriate form guid and load the right LOB form for the user.

    In the CRM 2013, I am not sure how to handle this scenario of switching formTypes programmatically? Any suggestions.

    Tuesday, October 28, 2014 2:31 AM

Answers

  • Hi,

    Script for navigating forms is same for CRM 2013 as well. You can use following script:

    Xrm.Page.ui.formSelector.items.get('form guid').navigate();

    However when user selects one of "LOB" in "Select BU" form, trying to navigating away form this form results in browser prompting to save or leave the page. This doesn't provide good 

    If you are looking for an alternative approach I suggest the following:

    You can add a new "FlyoutAnchor" command button with LOB options. You need to hide default "New" button for the entity. Use following script to open specific LOB form 

    var parameters = {};
    parameters["formid"] = "b053a39a-041a-4356-acef-ddf00182762b";
    Xrm.Utility.openEntityForm("account", null, parameters);

    You can use following script to disable form navigator.

    document.getElementById("crmFormSelector").disabled = true;


    Vikranth Pandiri Blog: http://howto-mscrm.blogspot.com Twitter: @TweetVikranth "Please Mark it as answer if it helps in resolving your query"

    • Marked as answer by CRMAdmirer Tuesday, October 28, 2014 11:42 AM
    Tuesday, October 28, 2014 6:13 AM

All replies

  • Hi,

    Script for navigating forms is same for CRM 2013 as well. You can use following script:

    Xrm.Page.ui.formSelector.items.get('form guid').navigate();

    However when user selects one of "LOB" in "Select BU" form, trying to navigating away form this form results in browser prompting to save or leave the page. This doesn't provide good 

    If you are looking for an alternative approach I suggest the following:

    You can add a new "FlyoutAnchor" command button with LOB options. You need to hide default "New" button for the entity. Use following script to open specific LOB form 

    var parameters = {};
    parameters["formid"] = "b053a39a-041a-4356-acef-ddf00182762b";
    Xrm.Utility.openEntityForm("account", null, parameters);

    You can use following script to disable form navigator.

    document.getElementById("crmFormSelector").disabled = true;


    Vikranth Pandiri Blog: http://howto-mscrm.blogspot.com Twitter: @TweetVikranth "Please Mark it as answer if it helps in resolving your query"

    • Marked as answer by CRMAdmirer Tuesday, October 28, 2014 11:42 AM
    Tuesday, October 28, 2014 6:13 AM
  • Thank you. This helps a lot. Will try it out.
    Tuesday, October 28, 2014 11:43 AM