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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to make checkbox automatically checked according to the selected value?

(0) ShareShare
ReportReport
Posted on by 1,905

On my contact form, I have a contact type drop-down list and a Contact Type Information section which includes checkbox for every contact type . When a contact type is selected from the drop-down list, the checkbox for that contact type in the Contact Type Information section needs to be systematically checked and become a read-only field.   All other contact type check boxes in the Contact Type Information section would remain editable and should be able to be manually selected as an additional contact type.

How can I achieve this function?

Thank you

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    CRMInnovation.com Profile Picture
    on at

    Create a PBL to implement this requirement. No code is required.

    Fellow MVP Jukka has a good post that should teach you what you need.

    niiranen.eu/.../getting-your-head-around-dynamics-crm-2013-processes-part-2

  • Vijay Waghmare Profile Picture
    on at

    If you are using crm 2013 then business rule will work for you else you need to depend on JavaScript to achieve your functionality.

    Thanks,

    Vijay Waghmare

  • Vijay Waghmare Profile Picture
    on at

    If you are using crm 2013 then business rule will work for you else you need to depend on JavaScript to achieve your functionality.

    Thanks,

    Vijay Waghmare

  • David1213 Profile Picture
    1,905 on at

    Thank you. But i'm using CRM 4.0, can I achieve the functionality by creating PBL?

  • David1213 Profile Picture
    1,905 on at

    Thanks Vijay, where can I find JScript source code to achieve this functionality? I'm not familiar with JavaScript programming.

  • Verified answer
    Demian Rashkovan Profile Picture
    130 on at

    hi, the code you need for CRM 4.0 is:

    if (crmForm.all.new_picklistfield.DataValue=="1")

    {

      crmForm.all.new_checkboxfield.DataValue=true;

      crmForm.all.new_checkboxfield.Disabled=true;

      crmForm.all.new_checkboxfield.ForceSubmit=true;

    }

    if you disable the field, this one is not sent to the server, so you need to force it with "ForceSubmit".

    regards

  • Hosk Profile Picture
    on at

    You will need to do this using Javascript on CRM 4.0

    Also when you make the field read only you need to add forceSubmit because CRM doesn't send this data to saved.

    The code above by  DEMIAN ADOLFO RASCHKOVAN  should do the job but you will of course have to change the name of the new_checkboxfield to the name of the checkbox field.

    good luck

  • Verified answer
    Vijay Waghmare Profile Picture
    on at

    You can make use of switch case based on selected contact type value, register an onchange event for dropdown control

    Modifying Damian’s code here

    crmForm.all.new_checkboxfield1.DataValue=false;

    crmForm.all.new_checkboxfield2.DataValue=false;

    crmForm.all.new_checkboxfieldN.DataValue=false;

    switch (crmForm.all.new_picklistfield.DataValue)

    {

    case  1:

      crmForm.all.new_checkboxfield1.DataValue=true;

      crmForm.all.new_checkboxfield1.Disabled=true;

      crmForm.all.new_checkboxfield1.ForceSubmit=true;

    break;

    case 2:

      crmForm.all.new_checkboxfield2.DataValue=true;

      crmForm.all.new_checkboxfield2.Disabled=true;

      crmForm.all.new_checkboxfield2.ForceSubmit=true;

    break;

    case N:

      crmForm.all.new_checkboxfieldN.DataValue=true;

      crmForm.all.new_checkboxfieldN.Disabled=true;

      crmForm.all.new_checkboxfieldN.ForceSubmit=true;

    break;

    }

    Thanks,

    Vijay Waghmare

  • David1213 Profile Picture
    1,905 on at

    Thank you so much guys.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans