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 :
Finance | Project Operations, Human Resources, ...
Suggested answer

Check box value not show

(0) ShareShare
ReportReport
Posted on by 35

Hi,

I have created new checkbox in runtime by x ,

It's working properly, But once, I wrote code for registeroverride method for clicked operation, check box not marked properly

Idea for that?

Thanks,

5635.pastedimage1678088408888v1.png

Ashok

 public void init()
    {
        super();
       
            FormGroupControl fds = FormGroupControl23 as FormGroupControl;
            FormCheckBoxControl chk = fds.addControl(FormControlType::CheckBox,"checkboxtest");
            chk.label("formcontroltest1");
            chk.style(1);
            chk.registerOverrideMethod(methodStr(FormCheckBoxControl, clicked),formMethodStr(form1control,DynamicButtonControl_Clicked),this);
        
    }
    
     public void DynamicButtonControl_Clicked(FormCheckBoxControl _formButtonControl)
    {
      info("I'm working");
    }

I have the same question (0)
  • Martin Dráb Profile Picture
    236,953 Most Valuable Professional on at
    RE: Check box value not show

    What exactly do you mean by "check box not marked properly"?

    Is it about Dynamics AX 2012 or Dynamics 365 for Finance and Operations?

  • Ashok ashok Profile Picture
    35 on at
    RE: Check box value not show

    Thanks for the reply martin,

    yes check box not marked.

    this is d365fo.

    Thanks

  • Martin Dráb Profile Picture
    236,953 Most Valuable Professional on at
    RE: Check box value not show

    I'm sorry, but I still don't understand the description of your problem. Please don't be shy using multiple sentences. Tell us what you're trying to do and how (in GUI or code) and what happens instead of what you expect.

    By the way, I moved your question to Dynamics 365 Finance Forum.

  • Arunraj Rajasekar Profile Picture
    1,743 on at
    RE: Check box value not show

    Hi Ashok,

    Are you trying to set default value as yes on the check box or trying to capture event when checkbox is modified. Can you elaborate your requirement.

  • Ashok ashok Profile Picture
    35 on at
    RE: Check box value not show

    Hi,

    I need to create check box control in the form, based another master form like maintain master,

    If maintain master contain 2 record, i need to create two checkbox in the form on run time,

    So i wrote logic above mentioned code.

    That code worked to create the check box control in runtime, but after wrote code for register override method for clicked method, if i tick check box, It's automatically changed as untick, i need to store that value in another table.

    How to do that? If i tick, it should be showing as tick, if i untick, it should be show as untick

    Thanks.

  • Ashok ashok Profile Picture
    35 on at
    RE: Check box value not show

    Hi,

    I need to create check box control in the form, based another master form like maintain master,

    If maintain master contain 2 record, i need to create two checkbox in the form on run time,

    So i wrote logic above mentioned code.

    That code worked to create the check box control in runtime, but after wrote code for register override method for clicked method, if i tick check box, It's automatically changed as untick, i need to store that value in another table.

    How to do that? If i tick, it should be showing as tick, if i untick, it should be show as untick

    Thanks.

  • Suggested answer
    Martin Dráb Profile Picture
    236,953 Most Valuable Professional on at
    RE: Check box value not show

    You didn't explain why you overrode the method, but I think you want to do something when the value changed. If so, you overrode a wrong method - use modified() instead of clicked().

    It's possible that overriding clicked() skips the standard logic that sets the value.

  • Ashok ashok Profile Picture
    35 on at
    RE: Check box value not show

    Even I override modified method that time also, same thing happened.

    why i override method: if that check box ticked, need to visible one custom date field.

    If untick the check box need to make visible false that custom date field.

    while open the form that time only need to create the check box control, that's why need to use register override method.

    Thanks.

  • Arunraj Rajasekar Profile Picture
    1,743 on at
    RE: Check box value not show

    If i understand your requirement correct, you have written the logic in form init, so whenever user open the form check box control will be added and then user will decide whether they want to see the custom date field or not by checking the check box?

    Since it is unbound control, whatever user set on the control will be cleared as soon as the form closes. have you considered using bound control?

  • Martin Dráb Profile Picture
    236,953 Most Valuable Professional on at
    RE: Check box value not show

    Before looking at detail of you implementation, let me question the whole design. It's possible that you're dealing with problems you've artificially created by a wrong design.

    I still know nothing about your business scenario (it's a pity that you didn't share that), but you seem to be saying that you want to create an unbound checkbox for every record in a data source. Why? Wouldn't it be a much more straightforward if you let the system create an bound checkbox for every record? It doesn't mean that the table needs a new field; you can use an edit method.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 696 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 569

#3
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans