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 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)
  • David1213 Profile Picture
    1,905 on at
    RE: How to make checkbox automatically checked according to the selected value?

    Thank you so much guys.

  • Verified answer
    Vijay Waghmare Profile Picture
    on at
    RE: How to make checkbox automatically checked according to the selected value?

    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

  • Hosk Profile Picture
    on at
    RE: How to make checkbox automatically checked according to the selected value?

    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
    Demian Rashkovan Profile Picture
    130 on at
    RE: How to make checkbox automatically checked according to the selected value?

    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

  • David1213 Profile Picture
    1,905 on at
    RE: How to make checkbox automatically checked according to the selected value?

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

  • David1213 Profile Picture
    1,905 on at
    RE: How to make checkbox automatically checked according to the selected value?

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

  • Vijay Waghmare Profile Picture
    on at
    RE: How to make checkbox automatically checked according to the selected value?

    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
    RE: How to make checkbox automatically checked according to the selected value?

    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

  • Suggested answer
    CRMInnovation.com Profile Picture
    on at
    RE: How to make checkbox automatically checked according to the selected value?

    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

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
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans