SBX - Search With Button

SBX - Forum Post Title

Form selection

Microsoft Dynamics CRM Forum

elsa_mina asked a question on 2 Nov 2015 12:22 PM

Question Status

Verified

Hi

I have 2 main forms in an entity. Each form contains different fields.

How can I customize the entity to select the form based on the fields that it contains.

For example if field b in Form B contains data then go and select form B rather than Form A.

Thank you

E

Reply
Devin Rawana responded on 2 Nov 2015 1:38 PM
My Badges
Suggested Answer

Hi Elsa,

You can programmatically change the form that your user is using by using some javascript.  Create a function and attach it to a fields on change event to fire.  You can also fire the function on load if a certain field contains data, ie if field B is not null.

Check this link, it should guide you in the right direction:

stackoverflow.com/.../how-to-change-default-form-based-on-dropdown-js-and-crm

Reply
yessoufy responded on 2 Nov 2015 1:59 PM
My Badges
Suggested Answer

you can add the field B into Form B and Form A (you can hide it in form A)

then in OnLoad event you can check if the field B contains data so select the right Form using the navigate method :

Xrm.Page.ui.formSelector.items("id").navigate();

Hope this help!

Reply
Verified Answer

You can swap the form using javascript. This link is to a blog post I wrote on this subject;

neilparkhurst.com/.../javascript-form-navigate

Reply
Aileen Gusni responded on 3 Nov 2015 12:03 PM
My Badges
Verified Answer

Hi Elsa

You really need two forms?

Because otherwise you just need to create 1 form with show hide the tab or section

If you need two forms you can refer here:

mscrmshop.blogspot.com/.../how-to-display-entity-form-based-on.html

ashwaniashwin.wordpress.com/.../navigating-to-multiple-forms-dynamically-using-jscript-in-crm-2011

Hope this helps.

Thanks

Reply
Verified Answer

You can swap the form using javascript. This link is to a blog post I wrote on this subject;

neilparkhurst.com/.../javascript-form-navigate

Reply
Aileen Gusni responded on 3 Nov 2015 12:03 PM
My Badges
Verified Answer

Hi Elsa

You really need two forms?

Because otherwise you just need to create 1 form with show hide the tab or section

If you need two forms you can refer here:

mscrmshop.blogspot.com/.../how-to-display-entity-form-based-on.html

ashwaniashwin.wordpress.com/.../navigating-to-multiple-forms-dynamically-using-jscript-in-crm-2011

Hope this helps.

Thanks

Reply
Devin Rawana responded on 2 Nov 2015 1:38 PM
My Badges
Suggested Answer

Hi Elsa,

You can programmatically change the form that your user is using by using some javascript.  Create a function and attach it to a fields on change event to fire.  You can also fire the function on load if a certain field contains data, ie if field B is not null.

Check this link, it should guide you in the right direction:

stackoverflow.com/.../how-to-change-default-form-based-on-dropdown-js-and-crm

Reply
yessoufy responded on 2 Nov 2015 1:59 PM
My Badges
Suggested Answer

you can add the field B into Form B and Form A (you can hide it in form A)

then in OnLoad event you can check if the field B contains data so select the right Form using the navigate method :

Xrm.Page.ui.formSelector.items("id").navigate();

Hope this help!

Reply

SBX - Two Col Forum

SBX - Migrated JS