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 AX (Archived)

Method to call when record is marked

(0) ShareShare
ReportReport
Posted on by 50

My requirement is when record is marked in grid, another record that link to mark record has be marked.

I want to know the method that is called when record is marked, so I can write my code in that method.

I already try to write method in formdatasource.mark and formdatsource.selectionchanged. It's not working.

*This post is locked for comments

  • Suggested answer
    Prasad.V Profile Picture
    185 on at

    try overwriting markChanged method on the form datasource.

  • Atiraj Profile Picture
    50 on at

    markChanged method is not work

  • Suggested answer
    nmaenpaa Profile Picture
    101,174 Moderator on at

    Use the active method on the data source. It's called whenever the selection (active record) changes.

  • Atiraj Profile Picture
    50 on at

    It's not work if user already active that record and then mark record. I want to trigger my code at the time that user mark record.

  • Suggested answer
    nmaenpaa Profile Picture
    101,174 Moderator on at

    What do you mean by "mark record"? If the record is already selected, then your code would already been triggered and show the related record. To my knowledge the system doesn't distinguish between selecting by clicking anywhere in the record, vs selecting by checking the small checkbox on the left side of the grid.

    Also, if you now automatically select another record, the selection of your original record would be removed, and the related record would be selected. This in turn would trigger your logic again, selecting the original record and so on. It would be an infinite loop.

    Instead of that, you have some options:

    1) Change the background color of the related record(s) (using displayOption method of the form data source). This requires refresh of the data source. 

    2) Use a display method / display field to show some kind of indicator on the related record(s). This requires refresh of the data source.

    Please note that the term marking in AX has it's own meaning (basically allocating certain inventory transactions to each other, such as a purchase line to fulfill a certain sales order). Instead we should talk about selecting / highlighting.

  • Community Member Profile Picture
    on at

    markChanged should work. Can you show some code?

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    I'm agree with lopidav, markChanged() method should work. And this method triggered then you mark or unmark record.

  • Dipen Sorathiya 555 Profile Picture
    50 on at

    hello all,

    I have same requirement.

    I want to do button enable when at least one record marked otherwise button is disabled 

    I create event handler of markchanged method but that method is not called when I mark the record

    any idea for this??

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Prashant Singh Profile Picture

Prashant Singh 2

#1
nmaenpaa Profile Picture

nmaenpaa 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans