Auto populate field?

yuppicide
Member Posts: 410
When I RunObject from a MenuButton is there a way to auto populate data?
Example: When I am on a Sales Order and go to print Sales Order it auto populates "No." field with the number of the current order you're working with.
I added a my own report to the Print MenuButton, but when it populates "No." it uses the last number I used, not the number you're actually trying to print. Any way to make that work?
Example: I am on Sales Order S135150, but when I go into to print my report S134870 shows up.
Example: When I am on a Sales Order and go to print Sales Order it auto populates "No." field with the number of the current order you're working with.
I added a my own report to the Print MenuButton, but when it populates "No." it uses the last number I used, not the number you're actually trying to print. Any way to make that work?
Example: I am on Sales Order S135150, but when I go into to print my report S134870 shows up.
0
Comments
-
You could take a look at how standard NAV does this and for example examen function PrintSalesOrder in codeunit 229 Document-Print.
But an easier solution can be this:CLEAR(reportname); localrecord.SETRANGE("No.", "No."); reportname.SETTABLEVIEW(localrecord); reportname.RUNMODAL;
Where localrecord is Sales Header in your case.
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
Too bad I don't have the license to change Codeunits. Oh well.0
-
yuppicide wrote:Too bad I don't have the license to change Codeunits. Oh well.
This you can add to your page:CLEAR(reportname); localrecord.SETRANGE("No.", "No."); reportname.SETTABLEVIEW(localrecord); reportname.RUNMODAL;
Tino Ruijs
Microsoft Dynamics NAV specialist0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions