mibuso.com

Microsoft Business Solutions online community
It is currently Sat May 25, 2013 10:40 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Parameters from Form to Dataport
PostPosted: Thu Jun 24, 2004 4:18 pm 
Offline

Joined: Thu Jun 24, 2004 4:05 pm
Posts: 2
Location: Hjørring
Country: Denmark (dk)
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


Top
 Profile  
 
 Post subject: Re: Parameters from Form to Dataport
PostPosted: Thu Jun 24, 2004 8:02 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Thu Jan 02, 2003 6:37 pm
Posts: 7931
Location: Howell, MI
Country: United States (us)
Sure that is possibly :D

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:
Code: Select all
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:
Code: Select all
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)

_________________
Daniel Rimmelzwaan
MVP - Dynamics NAV


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 25, 2004 8:12 am 
Offline

Joined: Tue Jun 22, 2004 9:54 am
Posts: 10
Location: Krefeld
Country: Germany (de)
Apart from that, if you don't want to use a dataport - instance, you can start the dataport with
Code: Select all
"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.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Fri Jun 25, 2004 10:10 am 
Offline

Joined: Thu Jun 24, 2004 4:05 pm
Posts: 2
Location: Hjørring
Country: Denmark (dk)
Thanks for the solutions. I have tried them both with succes, so I am glad :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: