赛捷软件论坛's Archiver

lynn.yu 发表于 2018-10-16 16:13

[KB功能解说] 如何通过定制程序锁定表中的记录?

[b]适用产品版本[/b]
Sage X3 V5、V6、V7、PU8、PU9、PU10


[b]模块[/b]
管理


[b]问题概要[/b]
有时,支持顾问可能必须锁定表中的某条记录,以便模拟不同用户同时使用某个功能的场景,以及模拟一些用户在X3中使用某些功能时进程大规模崩溃的场景等。

例如,如果有用户(例如通过创建一项收货)正在更新STOCK表的话,那么根据领料单创建发货的FUNPREDLV功能就无法正常运作。


[b]详细信息
解决方法[/b]
对于这种问题,可以通过如下这种定制程序在STOCK表中创建一项锁定:

If !clalev([STO]): Local File STOCK[STO]:ENDIF:FILTER [STO]

Trbegin [STO] #----table abbreviation

Readlock [STO]STO1 = 'P21';'';'BMSMN00206' With lockwait = 1 #---Choose the table index and enter the criteria you want to lock

If fstat = 0

Infbox "The product BMSMN00206 is locked" #---- The message will show up, the record will be locked until you press the OK button

Endif

Commit

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.