WHILE (TRUE) DO BEGIN IF SalesAgent.FINDSET THEN REPEAT SELECTLATESTVERSION; Customer.RESET; Customer.CHANGECOMPANY(SalesAgent.Company); IF Customer.FINDSET THEN REPEAT ExportCustCredit(SalesAgent, Customer."No."); UNTIL Customer.NEXT = 0; UNTIL SalesAgent.NEXT = 0; SalesSetup.GET; SLEEP(SalesSetup."Export CustCredit Interval" * 1000 * 60); END;
Answers
RIS Plus, LLC
RIS Plus, LLC
What code is in the function?
Thanks a lot!
The code in the function is this:
Reading the code, it should only lock the CustCredit-table.
Does it lock also the customer table?
Is Always Rowlock = TRUE in the "Alter Database"?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
This is not very nice code for SQL. Check your client monitor.
Better is to check with a GET first.
Ok, thanks for the tip. I have changed it
No it is false. Is this why it locks the whole table?
Btw do you have any info about how to create this event onTimer for a codeunit? I tried a search but didn't find anything.
Just run your code "OnTimer"- event, and make that your timer runs every "SalesSetup."Export CustCredit Interval" * 1000 * 60" .
So:
OnRun:
SetupYourTimer
OnTimer:
RunYourCode
Usually I do something more:
OnRun:
SetupYourTimer
OnTimer
Stop_Timer
RunCode
Start_Timer
OnTimer_Error
HandleError
Start_Timer
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Yes. "'Navision Timer 1.0'.Timer"
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog