Skip to main content

Notifications

Announcements

No record found.

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");
    }

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Check box value not show

    As Martin mentioned, you need to review your design. If requirement is to use checkbox field to show/hide custom date field then why not to go with Table field or edit method instead of creating checkbox at runtime.

    Please provide more details of you requirement if there is any reason to add runtime checkbox.

  • Martin Dráb Profile Picture
    Martin Dráb 230,962 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.

  • Arunraj Rajasekar Profile Picture
    Arunraj Rajasekar 1,731 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?

  • Ashok ashok Profile Picture
    Ashok ashok 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.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,962 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
    Ashok ashok 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
    Ashok ashok 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.

  • Arunraj Rajasekar Profile Picture
    Arunraj Rajasekar 1,731 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.

  • Martin Dráb Profile Picture
    Martin Dráb 230,962 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.

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

    Thanks for the reply martin,

    yes check box not marked.

    this is d365fo.

    Thanks

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans