Hi,
Is there an issue with Dispatch.StartTransaction() method? It is not working for me.
Below is an example
Dispatch.StartTransaction();
bool error = false;
for (int i = 0; i
{
Record entityRecord = FindRecord("Company", "comp_companyid=" + i);
string someField = Dispatch.ContentField("someField"+i);
if (someField == "something")
{
error = true;
}
else
{
entityRecord.SetField("somefield", someField);
entityRecord.SaveChanges();
}
}
if (error)
{
Dispatch.Rollback();
}
else
{
Dispatch.Commit();
}
I have checked the SQL logs in CRM and it does not add the corresponding SQL statement, but Select and Updated are added.
Regards,