Quantcast
Channel: Sage X3 – Tips, Tricks and Components
Viewing all articles
Browse latest Browse all 1519

Locking a record for specific time

$
0
0

Lockwait sets the number of seconds that each attempt will last at locking a record, file, or symbol.

New Stuff: How to enable search engine in Sage X3 V8

Please check out below code snippet for how to Limit the length of the lock attempts to five seconds.

###################################################

lockwait = 5

Trbegin

Lock COMPTEUR

If fstat

BADLOCK = 1

Rollback

Else

[C]COMPTEUR += 1

Commit

Endif

###################################################

This code will lock the record COMPUTER for five seconds and will release it automatically.

Lockwait is an Adonix system variable of the Integer type, which allows you to set the maximum of seconds that each lock attempt will last via the Lock and Readlock instructions.

Lockwait can have all values from 2^31 -1 to 2^31. If its value is negative, the attempt time will be unlimited. If its value is null, a single attempt will be made.

The Lock (or Readlock) syntax With lockwait = allows you to assign this variable for a short while.

This instruction is not interruptible – even if the program is (by Inter).

Lockwait is not taken into account by the For, With, Lock, and Update instructions. A single attempt will be made for these instructions.

Hope this helps!!

Also Read:

1)How to check if the transaction is being locked in another workstation?

2)How to block order if Prepayment is not done?

3)How to Unlock your Process in Sage X3

4)How to enable search engine in Sage X3 V8

5)How to restrict purchase invoice creation without purchase receipt?

 


Viewing all articles
Browse latest Browse all 1519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>