BeginTrans()

Starts transaction for the following SQL statements.

This transaction must be closed either by CommitTrans() or RollbackTrans().

Use this method to prevent dead locking when using table level scripts. Exercise extreme caution when using this method because all transactions must be closed properly. Use the coding practice showed in the example below.

Parameters

None

Examples

var updatequery;
updatequery = CRM.CreateQueryObj(sql);
try
{
updatequery.BeginTrans();
updatequery.ExecSql();
updatequery.CommitTrans();
}
catch(ex)
{
updatequery.RollbackTrans();
}