locked
Microsoft CRM 2011 Forms RRS feed

  • Question

  • Thanks for any help.

    I am new to Microsoft CRM, and the following is a scenerio that I have.

    We are utilizing CRM mainly for Service Activity Schedules. My question is, that if I want to use Multiple Case Forms to collect information. I am using the same USER to collect this information. So I do not want to base the form on the USER's Security Role. Is there an easy way to change the Form from A to B right after hitting Case>New.

    I am not in construction....but let's say I want to select a different "Case Form" if I am working on one line of product verses another line of product.

    Thank you so much for your help on this

    EStoddard

     


    EStoddard
    Tuesday, August 2, 2011 10:47 PM

Answers

  • You can programmatically select the current form for an entity instance using the new Xrm javascript object model:

     

    Xrm.Page.ui.formSelector.items.get("<formName>").navigate();
    
    

    Such code could be triggered via an attribute OnChange event or based upon data within the entity instance in the form OnLoad.  If you change the view in OnLoad, remember the following (from the SDK):

    Use Form Scripting

    Finally, you can use scripts in the form Onload event to use the Xrm.Page.ui.formSelector Remember that the navigate method will cause the form to load again (and the Onload event to occur again). Your logic in the event handler should always check some condition before you use the navigate method to avoid an endless loop or unnecessarily restrict users options to navigate between forms.

     

     


    --pogo (pat) @ pogo69.wordpress.com
    • Proposed as answer by Ayaz.AhmadModerator Wednesday, August 3, 2011 12:17 AM
    • Marked as answer by EStoddard Tuesday, August 9, 2011 7:08 PM
    Tuesday, August 2, 2011 11:07 PM
  • Thanks for the help... I will give this a shot...

     

    Just joined this Forum... You folks are FAST! :)


    EStoddard
    • Marked as answer by EStoddard Monday, August 8, 2011 9:48 PM
    Wednesday, August 3, 2011 12:37 AM

All replies

  • You can programmatically select the current form for an entity instance using the new Xrm javascript object model:

     

    Xrm.Page.ui.formSelector.items.get("<formName>").navigate();
    
    

    Such code could be triggered via an attribute OnChange event or based upon data within the entity instance in the form OnLoad.  If you change the view in OnLoad, remember the following (from the SDK):

    Use Form Scripting

    Finally, you can use scripts in the form Onload event to use the Xrm.Page.ui.formSelector Remember that the navigate method will cause the form to load again (and the Onload event to occur again). Your logic in the event handler should always check some condition before you use the navigate method to avoid an endless loop or unnecessarily restrict users options to navigate between forms.

     

     


    --pogo (pat) @ pogo69.wordpress.com
    • Proposed as answer by Ayaz.AhmadModerator Wednesday, August 3, 2011 12:17 AM
    • Marked as answer by EStoddard Tuesday, August 9, 2011 7:08 PM
    Tuesday, August 2, 2011 11:07 PM
  • Thanks for the help... I will give this a shot...

     

    Just joined this Forum... You folks are FAST! :)


    EStoddard
    • Marked as answer by EStoddard Monday, August 8, 2011 9:48 PM
    Wednesday, August 3, 2011 12:37 AM