SLEEP
Use this function to return control to the operating system for a specifiable amount of time.
SLEEP(Duration)
Duration
Data type: integer
The number of milliseconds to return control to the operating system for.
Comments
When using SLEEP, control is guaranteed to return to the operating system for at least Duration milliseconds (implying that the period may be longer, depending on what the operating system is doing at the time when control is to return to the caller.)
For example: You execute a batch during the NAS. And in this batch you block the, for example, Customer Table.
So with sleep, for example every 100 Recs, you give other processed the chance to handle the customer (blocked) table.
A) The user uploads a file that on-the-fly creates sales orders and posts them. Since posting will block tables Value Entry, G/L Entry, Item Ledger Entry etc I use the SLEEP function in order to allow the rest of the users to post their orders without being locked for the time needed to post some thousands of orders coming from the file...
I generate six different reports printed through a generic text printer to a file all at the same time. I use this function to give the OS some time to rename the first produced file before trying to overwrite it...
Comments
For example: You execute a batch during the NAS. And in this batch you block the, for example, Customer Table.
So with sleep, for example every 100 Recs, you give other processed the chance to handle the customer (blocked) table.
Regards
anything more ??
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
A) The user uploads a file that on-the-fly creates sales orders and posts them. Since posting will block tables Value Entry, G/L Entry, Item Ledger Entry etc I use the SLEEP function in order to allow the rest of the users to post their orders without being locked for the time needed to post some thousands of orders coming from the file...