Hi guys,
I want to periodically run a dataport,NAS does not allow dataports to be run.its a text file that i am importing,can xml ports help.
can odbc or cfront help...
please give some ideas since clinet license does not have job schedular
We ran into this problem too. Unfortunately we just had to convert the dataports to codeunits. There we put the code to open the file, parse the line, and fill in the fields as we found them.
Hi, i've had the same problem recently, i ended up stealing a function from these forums which made work a bit easier, and adding it to a codeunit and calling the codeunit with NAS. Here is the function:
FUNCTION GetFieldContent
PARAMETERS
----------
Var Name DataType Subtype Length
No parFieldNo Integer
No parTxt Text 1024
LOCAL VARIABLES
---------------
Name DataType Subtype Length
ReturnString Text 1024
FieldsFound Integer
boo Integer
CounterPOS Integer
RETURN VALUE
------------
Type = Text
Length = 1024
CODE
----
ReturnString := '';
FieldsFound := 1;
boo := -1;
REPEAT
CounterPOS += 1;
IF parTxt[CounterPOS] = '"' THEN
boo *= -1
ELSE BEGIN
IF (parTxt[CounterPOS] = ',') AND (boo = -1) THEN
FieldsFound += 1
ELSE
IF FieldsFound = parFieldNo THEN
ReturnString := ReturnString + COPYSTR(parTxt,CounterPOS,1);
END;
UNTIL (CounterPOS = STRLEN(parTxt)) OR (FieldsFound > parFieldNo);
EXIT(ReturnString);
Basically i open the file, and in a repeat loop load the next line into a very large text variable, which i pass to that function along with the field number i want, for example:
Customer.Name := getfieldcontent(1,templine) will pull the content of the first field in "templine" (my variable storing the line) and assign it to the customer name.
It wasn't much fun because of the massive amount of fields i was importing, but the above function made my life much easier, and we haven't had any troubles with it yet.
Function/Trigger Line No. Description
OnRun 1 Type "Dataport" not supported
OnRun 2 Type "Dataport" not supported
OnRun 3 Type "Dataport" not supported
OnRun 4 Type "Dataport" not supported
OnRun 2 Function 'FILENAME' is obsolete for Microsoft Dynamics NAV Server.
OnRun 3 Function 'IMPORT' is obsolete for Microsoft Dynamics NAV Server.
OnRun 4 Function 'RUN' is obsolete for Microsoft Dynamics NAV Server.
I m asking did you found a solution for that error , i wrote the same code into a codeunit and i exspose this codeunit as webservice , when i call this webservice(from a c sharp code) , i have exactlly the same error that you have . can you tell me please why i have this error ?? !
Ofcourse you get errors when copying that code.
The post is from 2007, when NAV 2009 wasn't out yet. Dataports don't exist in that version, everything is xml-port.
Also Filename, import and run are obsolete for the RTC. If you want that code to run, you need to check with isservicetier.
Remember, it's not copy/paste but think/copy/paste
|Pressing F1 is so much faster than opening your browser| |To-Increase|
Comments
Not a lot of fun, but it should do to the job.
You can create a codeunit to run your dataport and schedule it thruogh the job scheduler
Make sure that the dataport has the property UseReqForm set to No
Regards
Albert
http://www.BiloBeauty.com
http://www.autismspeaks.org
Maybe you could set it up in codeunit 1 with an OnTimer property.
Albert
Basically i open the file, and in a repeat loop load the next line into a very large text variable, which i pass to that function along with the field number i want, for example:
Customer.Name := getfieldcontent(1,templine) will pull the content of the first field in "templine" (my variable storing the line) and assign it to the customer name.
It wasn't much fun because of the massive amount of fields i was importing, but the above function made my life much easier, and we haven't had any troubles with it yet.
Hope that helps.
I m asking did you found a solution for that error , i wrote the same code into a codeunit and i exspose this codeunit as webservice , when i call this webservice(from a c sharp code) , i have exactlly the same error that you have . can you tell me please why i have this error ?? !
The post is from 2007, when NAV 2009 wasn't out yet. Dataports don't exist in that version, everything is xml-port.
Also Filename, import and run are obsolete for the RTC. If you want that code to run, you need to check with isservicetier.
Remember, it's not copy/paste but think/copy/paste
|To-Increase|