Detecting whether a record is in multirecord update mode

You can detect whether a record is in multirecord update mode by using the ratl_MultiModifyBatchMode session variable.

The value of ratl_MultiModifyBatchMode is the display name of the record that is currently being edited. The value of ratl_MultiModifyBatchMode is empty if no multirecord update is in progress.
Note: The value of ratl_MultiModifyBatchMode is critical when the user changes other records during the multirecord update. While a record is being edited by a multirecord update operation, you can update another record that is not part of the multirecord update result set. If the hook does not check the value of ratl_MultiModifyBatchMode, the hook might think that the record is being operated on by a multirecord update when it is not.
The following example shows how to check the ratl_MultiModifyBatchMode session variable.
VBScript
dim currDBSession ' Current Db session 
dim currDisplayName ' Current record ID
set currDBSession = GetSession 

currDisplayName = GetDisplayName 


if currDBSession.NameValue("ratl_MultiModifyBatchMode") = currDisplayName then
' do something
end if

 
Perl
my $name = $entity->GetDisplayName(); 
if ($session->GetNameValue("ratl_MultiModifyBatchMode") eq $name) { 
   # The current record is part of a multirecord update. 
   return 0; 
} 
return 1;