Automatically running a datport

amankakar
Member Posts: 44
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
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
0
Comments
-
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.
Not a lot of fun, but it should do to the job.0 -
Hi
You can create a codeunit to run your dataport and schedule it thruogh the job schedulerCLEAR(MyDataport); MyDataport.FILENAME := FileName; MyDataport.IMPORT := TRUE; MyDataport.RUN();
Make sure that the dataport has the property UseReqForm set to No
Regards
Albert0 -
amankakar wrote:clinet license does not have job schedular0
-
Sorry didn't see that.
Maybe you could set it up in codeunit 1 with an OnTimer property.
Albert0 -
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.
Hope that helps.0 -
i'm getting error with that codeFunction/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.0 -
hi julkifli33 ,
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 ?? !0 -
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/paste0 -
Thks Sog for the information0
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