Hi,
Any one can help ?
using Navision 2016 CU 24 application .
designed two table with ID 50130 and ID 50131
Navision database is SQL 2014 std SP2(service pack 2)
create link server in Navison in SQL 2014 with another SQL 2008 R2
and used the ADO connection to import data from SQL 2008 table to Navision table by using code unit ( running through JOB que entries)
lADOConnection.Open;
lVarConnection := lADOConnection;
lADOCommand := lADOCommand.OdbcCommand();
lADOCommand.CommandTimeout(0);
Table ID 50130 upadated regularly without any issue.
in next step trying to copy data from Navision table ID 50130 to 50131 , using another code unit (running through JOB que entries)
OnRun()
Frecordinsert(); ///Function created to insert data from Table 50130 to 50131
LOCAL Frecordinsert()
CLEAR(CMS_EXP_TRA); //// CMS_EXP_TRA is a record of table ID 50130
RecCMSEXPTRA.RESET; /// RecCMSEXPTRA is a record of table ID 50130
IF RecCMSEXPTRA.FINDFIRST THEN REPEAT
//CMS_EXP_TRA.RESET;
CMS_EXP_TRA.SETRANGE(CMS_EXP_TRA.EntryNo,RecCMSEXPTRA.EntryNo);
IF CMS_EXP_TRA.FINDFIRST THEN BEGIN
CMS_EXP_TRA.GenJour:= TRUE;
CMS_EXP_TRA.MODIFY;
END;
UNTIL RecCMSEXPTRA.NEXT=0;
////////////////////////////////////////////
GCMS_EXP_TRA1.RESET; //// GCMS_EXP_TRA1 is a record of table ID 50130
IF GCMS_EXP_TRA1.FIND('-') THEN
REPEAT
GCMS_EXP_INT_TRA.INIT; /////GCMS_EXP_INT_TRA is a record of table ID 50131
GCMS_EXP_INT_TRA.VALIDATE(EntryNo,GCMS_EXP_TRA1.EntryNo);
GCMS_EXP_INT_TRA.VALIDATE(DocumentNo,GCMS_EXP_TRA1.DocumentNo);
GCMS_EXP_INT_TRA.JournalTempName:='GENERAL';
GCMS_EXP_INT_TRA.JournalBatchName:='INTERFACE';
GCMS_EXP_INT_TRA.SourceCode:='CASHRECJNL';
GCMS_EXP_INT_TRA.VALIDATE(LineNo,GCMS_EXP_TRA1.LineNo);
GCMS_EXP_INT_TRA.VALIDATE(AccountNo,GCMS_EXP_TRA1.AccountNo);
GCMS_EXP_INT_TRA.VALIDATE(PostingDate,GCMS_EXP_TRA1.PostingDate);
GCMS_EXP_INT_TRA.VALIDATE(DocumentType,GCMS_EXP_TRA1.DocumentType);
GCMS_EXP_INT_TRA.VALIDATE(BalAccountNo,GCMS_EXP_TRA1.BalAccountNo);
GCMS_EXP_INT_TRA.VALIDATE(ExternalDOC,GCMS_EXP_TRA1.ExternalDOC);
GCMS_EXP_INT_TRA.VALIDATE(Amount,GCMS_EXP_TRA1.Amount);
GCMS_EXP_INT_TRA.VALIDATE(SBUCode,GCMS_EXP_TRA1.SBUCode);
GCMS_EXP_INT_TRA.VALIDATE(CenterCode,GCMS_EXP_TRA1.CenterCode);
GCMS_EXP_INT_TRA.VALIDATE(EMPLOYEECODE,GCMS_EXP_TRA1.EMPLOYEECODE);
GCMS_EXP_INT_TRA.VALIDATE(LocationCode,GCMS_EXP_TRA1.LocationCode);
GCMS_EXP_INT_TRA.VALIDATE(StateCode,GCMS_EXP_TRA1.StateCode);
GCMS_EXP_INT_TRA.GenJour:=FALSE;
GCMS_EXP_INT_TRA.GenLed:=FALSE;
IF GCMS_EXP_INT_TRA.INSERT THEN;
UNTIL GCMS_EXP_TRA1.NEXT=0;
job que entry executed without any error.
any new record are coming from SQL 2008 R2 to Table 50130 not inserting automatically in Table ID 50131
if run the Code unit manually then it inserted without any issue in Table ID 50131
Please help
*This post is locked for comments
MODIFYALL function is the perfect answer of above query
I mean NAV server not DB server, anyhow is your codeunit set as Single Instance ? One easy way is debug your Job Queue sessions and check if it stepping through your code or not.
Dear Mr Skkulla,
yes running the codeunit (job que )in database server only.
Dear Stefano,
thanks for suggestion. NAS configured correctly , because other job entries are running with the same setup and related job que entry setup is also correct.
Reason: If 10 records are available in table 1
1. Rum the code unit manually , all 10 records copied from table 1 to table 2
2. deleted the all 10 records in table2
3. one more records add in table 1 now total records are 11
4. now run the job que
5. Table 2 allow only 10 record, 1 is pending to insert in table 2.
Did you run the codeunit on the server or from your local machine, can you run the codeunit from the server and see if you get any errors?
Is the NAS correctly configured and running? Have you checked this? Are there error logs in the Job task? Is the ADO component installed on the server?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156