xSession::lastUpdateConflictingTable Method [AX 2012]

Retrieves an instance of the table that most recently had an update conflict.

client server public static Common lastUpdateConflictingTable()

Run On

Called

Return Value

Type: Common Table
An instance of the table that most recently had an update conflict.

The following example demonstrates the general use of the lastUpdateConflictingTable method—it enables you to abort or retry transactions according to which table has an update conflict.

try 
{ 
    // ... 
    table1.update(); 
    // ... 
    table2.update(); 
} 
catch(Exception::UpdateConflict) 
{ 
    if(xSession::lastUpdateConflictingTable() == table1) 
    { 
        ttsabort; 
    } 
    else if(xSession::lastUpdateConflictingTable() == table2) 
    { 
        // Compensate here. 
        // ... 
        retry; 
    } 
}
Show: