Parameters from Form to Dataport

KennethP
Member Posts: 3
I have made a dataport that can import data into a General Journal. I have also made a button in Form 39 "General Journal", that starts the dataport.
My problem is that I do not want the user to choose the: "Journal Template Name" and "Journal Batch Name" in the dataport, but simply send these from the form. I have not been able to do that. Is it possibly? If so, how?
Regards
My problem is that I do not want the user to choose the: "Journal Template Name" and "Journal Batch Name" in the dataport, but simply send these from the form. I have not been able to do that. Is it possibly? If so, how?
Regards
0
Comments
-
Sure that is possibly
Add two global code10 variables to your dataport (TemplateName and BatchName). Add a function called SetValues to your dataport, with two parameters (parTemplateName and parBatchName). In the function, you write the following code:TemplateName := parTemplateName; BatchName := parBatchName;
Then, in the OnPush trigger of your button, you call your new function with the current template and batchname, so that looks something like this:MyDataport.SetValues("Journal Template Name","Journal Batch Name"); MyDataport.RUNMODAL;
Make sure that your dataport is a variable of the datatype dataport, otherwise this won't work. By calling the SetValues function from the General Journal Form, you put values in the global variables that you can then use throughout your dataport.
Good luck, HTH 8)0 -
Apart from that, if you don't want to use a dataport - instance, you can start the dataport with
"Gen. Journal Line".RESET; "Gen. Journal Line".SETRANGE("Journal Template Name", 'WHATEVER'); "Gen. Journal Line".SETRANGE("Journal Batch Name", 'WHATEVER'); DATAPORT.RUNMODAL(DATAPORT::"Import Gen. Journal Line", TRUE, "Gen. Journal Line");
Of course I agree about everything my predecessor proposed.
Good luck.0 -
Thanks for the solutions. I have tried them both with succes, so I am glad0
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