If you just want to set different than default sorting order, different but still fixed, you can simply set RunFormView property on button which is used to run the form. IF the form is launched via button
In order to have full flexibility you can write some code in OnLookup trigger.
1. Create variable based on form fou want to display
2. Create record on wchich the form is based
3. use SETCURRENTKEY on record to select key you want to display
4. you may also use SETFILTER if there is a need to narrow number of records
5. write formbasedvariable.SETTABLEVIEW(recordbasedvariable)
6. write formbasedvariable.RUNMODAL or formbasedvariable.RUN
If you want to pick some selected data from displayed form you'll have to write additional some code.
Comments
You can do it in two ways
If you just want to set different than default sorting order, different but still fixed, you can simply set RunFormView property on button which is used to run the form. IF the form is launched via button
In order to have full flexibility you can write some code in OnLookup trigger.
1. Create variable based on form fou want to display
2. Create record on wchich the form is based
3. use SETCURRENTKEY on record to select key you want to display
4. you may also use SETFILTER if there is a need to narrow number of records
5. write formbasedvariable.SETTABLEVIEW(recordbasedvariable)
6. write formbasedvariable.RUNMODAL or formbasedvariable.RUN
If you want to pick some selected data from displayed form you'll have to write additional some code.
Regards,
Slawek.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Seach for the function called ASCENDING in the C/SIDE help.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Just create a form with the View you want then copy the SourceTableView, don't save the form.
Like I have done Here with the Item Table.
myItem.SETVIEW('SORTING(No.) ORDER(Descending)');
Please let us know if it works ok.
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com