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)

How to change Form on the basis of field value ?

(0) ShareShare
ReportReport
Posted on by 2

I have a drop down on CONTACT having values

1) CONSUMER

2)CARPORATE

i want to show consumer page on the basis of contact  type.

for example. if the contact is single i ll show CONSUMER and if contact type is multiple i ll show CARPORATE.

any help plz

i need a javascript to run on load of contact form.

thanks

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at
    RE: How to change Form on the basis of field value ?

    Hi Zia,

    You can use this javascript, this is a good reference.

    blog.webfortis.com/javascript-form-selector

    You can use this to get your Contact type (based on your field name)

    Var type  = Xrm.Page.getAttribute("new_type") : The Option Set object of Type field.

    and use the form selector navigation javascript

    switch (type.getText()) {

                   case "COLD":

                       Xrm.Page.ui.formSelector.items.get(COLD).navigate();

                       break;

                   case "WARM":

                       Xrm.Page.ui.formSelector.items.get(WARM).navigate();

                       break;

                   case "HOT":

                       Xrm.Page.ui.formSelector.items.get(HOT).navigate();

                       break;

               }

    Reference for form selector:

    msdn.microsoft.com/.../gg309560.aspx

    Hope this helps!

    Thanks.

  • zia ul haq Profile Picture
    2 on at
    RE: How to change Form on the basis of field value ?

    thanks it workd fine :)

  • Community Member Profile Picture
    on at
    RE: How to change Form on the basis of field value ?

    Good technical reference.  Thank you Aileen

    harihar

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#3
SC-08081331-0 Profile Picture

SC-08081331-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans