Is is possible to identify the currently selected rows in a grid on a form?
I want the user to select a few rows with shift.click and to then click on a button to perform an action on those rows.
I thought it might be the Markedonly function but it doesn't appear to do what I want.
0
Comments
RIS Plus, LLC
Thanks, all I needed was a starting point.
Ian
Look at the GetSelectionFilter() function on the main list forms (item,customer,vendor) which uses CURRFORM.GETSELECTIONFILTER funchion and is very useful
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Ian
Lokk in the master list forms e.g. form 31 Item list - this function is used from the Analysis By Dimension form 7158 in the onlookup trigger of the item filter and works like
item selected 1000,1001,1002,7000
returns string 1000..1002|7000 8)
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
but it fails on the first line with an error saying But I haven't asked it copy anything so what is it going on about?
The only documentation consists of a single, not very helpful line.
When I am in a Sales Order (form 42) do I need to use CurrForm to refer to the sales line or should I be somehow tracking down the subform object and using that?
What does the SetSelectionFilter method actually do?
I have to pass it a record - but it doesn't say *what* record - will this contain the resultset or is it the set of records in the form?
Since it doesn't return a result, what does it do with this record?
The SETSELECTIONFILTER command works on the source table on the calling form so if your case the command will return Sales Header record(s) and you are trying to assign this to a sales line. If you want to select the subform that you will need to use the SETSELECTIONFILTER is the sub-form and process from there. If you want to button on the main form then write a function in the sub-from and call this from the main form.
Hope this helps.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
I've been digging around for a way to find a reference to the subform table.
Thanks
Ian
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Modify the subform showing the lines you want the user to multi-select. Add a button and attach something like the code below to the onpush. It makes a change to each selected line on a grid.