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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

checkbox in Grid

(0) ShareShare
ReportReport
Posted on by 1,559

Hi Friends,

I have a bound checkbox in grid, I can overwrite 'click' or 'modified' method for it, but, none would fired when I clicked on checkbox.

Is this typical behavior since it's in grid? what alternative I can do if I need to do something when it's clicked.

Thanks,

*This post is locked for comments

I have the same question (0)
  • Dan Emreus Profile Picture
    1,162 on at

    Hi Ganriver,

    I am not sure what you would like to happen after you clicked on your checkbox but it should not be a problem to add a click-method on your field and add some logic. Can you please explain what you want to happen when you click on your checkbox?

    /Dan

  • Ganriver1 Profile Picture
    1,559 on at

    Hi Dan,

    I want to do some logic checking on the line record. But, it doesn't go there. It did fire up in datasource 'modified' method, but, not 'click' method on checkbox.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    Hi Ganriver,

    You should not use clicked method on grid at all because users can add same field to grid again using personalization and it won't have you "click" method.

    Modified() method of form data source field is a right place to put your code. 

     

  • Suggested answer
    Dan Emreus Profile Picture
    1,162 on at

    I agree with Ievgen, I missed that your checkbox was a field connected to a real datasource.

    If you want to validate something I think you should use the validatefield method directly on the table.

    Otherwise it should work to use the modified method.

    If values is changed you also might want to do a datasource refresh after the super() method.

    Good luck

    /Dan

  • Ganriver1 Profile Picture
    1,559 on at

    Following my previous question, how do I reference previous value of checkbox in modified method?

    Thanks,

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Checkbox has just two values. If you know the value after change, figuring out the value before the change shouldn't be difficult. :)

    Maybe you should explain what you're trying to achieve.

  • Ganriver1 Profile Picture
    1,559 on at

    Hi Martin,

    I used datasource.field to reference the previous value in modified method, which is ok. But when I unchecked box, it's still old value of 'unchecked'.

    If I press 'F5' to refresh after check one, then other checkbox checked while this one got unchecked. It seems confused about active record.

    That's why I am asking the question.

    Thanks,

  • Ganriver1 Profile Picture
    1,559 on at

    one more thing, in modified method, following were called.

       datasource_ds.write();

       datasource_ds.reread();

      datasource_ds.refresh();

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Please first tell us what you're trying to achieve from functional perspective; then we'll be able to tell you how to implement it. Your current code doesn't look as a good starting point.

  • Ganriver1 Profile Picture
    1,559 on at

    if checkbox is unchecked, when I click on it, I want to do some logic check, remind/warn user what's needs to be done.

    When I uncheck it, nothing needs to happen.

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans