레코드에 대한 잠금을 작성합니다.
레코드 잠금 획득에는 최대 대기 시간(초)을 지정할 수 있는 기능이 포함됩니다. 이 값은 잠금 시도에 실패하기 전에 기존 잠금이 해제될 때까지 대기하는 시간입니다. wait_seconds 매개변수에 지정된 값이 경과하기 전에 잠금을 획득할 수 없는 경우 잠금 시도에 실패합니다.
$entity->LockRecord(0);
VBScript
entity.LockRecord wait_seconds
Perl
$entity->LockRecord(wait_seconds);
VBScript
Function Defect_LockRecord(param)
' Lock Record for RECORD_SCRIPT_ALIAS action
' param As Variant
' record type name is Defect
REM add your hook code here
' don't wait
LockRecord(0)
End Function
Sub Defect_Initialization(actionname, actiontype)
' Lock Record for BASE action Action_Initialization hook
' actionname As String
' actiontype As Long
' action is LockRecord
' record type name is Defect
REM do any setup for the action here
LockRecord(0)
End Sub
Perl
sub Defect_LockRecord {
# Lock Record Script for RECORD_SCRIPT_ALIAS action
my($result);
my($param) = @_;
# record type name is Defect
if (ref ($param) eq "CQEventObject") {
# add your CQEventObject parameter handling code here
} elsif (ref (\$param) eq "SCALAR") {
# Add your scalar parameter handling code here
# The Web clients support scalar parameter type only,
# so the hook code added in the above section, needs to be duplicated here
} else {
# Add your handling code for other type parameters here, for example:
# die("Unknown parameter type");
}
# don't wait
$entity->LockRecord(0);
return $result;
}
sub Defect_Initialization {
# Lock Record script for BASE action Action_Initialization hook
my($actionname, $actiontype) = @_;
# $actionname as string scalar
# $actiontype as long scalar
# action is LockRecord
# record type name is Defect
# Do any setup for the action here.
$entity->LockRecord(0);
}