0

Dynamics NAV supports extended multi selection just like Windows. So, if in a Sales Order with 10 lines, if I click on line 3 and then hold down the Shift key and click line 7, lines 3 to 7 are highlighted and the OnAfterGetRecord and OnAfterGetCurrRecord events are fired for line 3 and line 7 respectively.

If I then hold down the Ctrl key and click lines 4 and 6, they now display as deselected (no longer highlighted), but no OnAfterGetRecord or OnAfterGetCurrRecord events are ever fired.

How can I trap the above situation with events?

Thanks in advance for any ideas and or suggestions.

j2associates
  • 1,115
  • 10
  • 19

2 Answers2

0

You can’t. I can guess you would like to show subtotals based on the current selection. As said, you can’t. The only way is to force user to apply filters to page or add refresh-totals button.

Mak Sim
  • 2,148
  • 19
  • 30
0

Please, notice than the events OnAfterGetRecord and OnAfterGetCurrRecord are not the same.OnAfterGetCurrRecord is fired when you are positioned in one record, and OnAfterGetRecord is launched before the record is shown in the page.

Regarding your question, this events are not launching when you are deselecting one record. There are no events for the action that you are performing: Documentation

The only thing you can do in this case is to provide a button to perform the code that you want to fire with your trigger, using the setselectionfilter function to retrieve the selected lines.

Hope this helps,

Kind regards.

AFR
  • 105
  • 4