Hello All,
We are using NAV 4.0 SP2 with SQL Server 2005. We are an enduser, and I have very little training with Navision. I am currently attempting to learn to program dataports. I can call a dataport from a codeunit to export data, however the request form opens. I tried to use the statement
USEREQUESTFORM(FALSE)
in the OnInitDataport trigger and get a compile error error stating
'You have specified an unknown variable.'
USEREQUESTFORM
'Define the variable inder 'Global C/AL symbols'.
I also tried calling it from a code unit in the OnRun trigger:
CLEAR(dp50117);
dp50117.SetVariables('002','A0422', First, Last);
dp50117.USEREQUESTFORM := FALSE;
dp50117.RUN;
Where dp50117 is the name of the variable name of the dataport .
I get same error message. With all this said could someone please explain the correct way to tell the dataport at run time not to use the request form. What I am trying to achieve is a dataport that can be run by a user and the request form will open, or be called from a code unit and the request form not open.
Thanks in advance for any advice.
Navision - ver. NA 4.00 (4.0 SP2)
0
Comments
Dynamics NAV Developer since 2005
Thanks in advance.
CurrDataport.IMPORT(FALSE);
That did not solve the problem.
When request form opens it is populated with all values passed to it from codeunit that called it, but user has to click OK button.
I am trying to create a dataport that can be run both unattended from a codeunit that passes the needed values and by user that inputs needed values. And dataport knows when to display request form and when not to display request form.
This is code from codeunit that calls dataport.
This is code of dataport:
Any and all suggestions welcome.
The pnly thing you need to provide by code is the path of the file.
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
dp50117.SetVariables('002','A0422', First, Last);
are lost. Variable name dp50117 , does not equate to Dataport(50117, FALSE). It is as if I am two different dataports.
I want the dataport to be runned with the requestform, when it is triggered maually, but when runned from a CU I want to put in parameters and run it without the requestform. (one of the parameters is filename)
Did you find a solution?
Here's how you can do it though.
prec is a Record::"370"
TVision Technology Ltd