As per this link and this one, if a contract has a status that is under the 'Activated' contract status category, the account name of that contract cannot change. This is a problem and I would argue it is a bug.
An idea has been open since 4 years to rectify this, however it looks like this issue won't be addressed soon.
Let's say I have contract A that is under Account 1, and contract A should actually be under Account 2 but it cannot be edited because contract A has a category of 'Activated'.
How can I rectify contract A so that it does indeed fall under Account 2? I was looking at cloning contract A via the .clone(true, true, true, true) method and then doing an update but this isn't working because the 'ENTITY_IS_LOCKED' error msg is being returned still*.
Besides from cloning the contract from scratch, is there a way around this? (it isn't ideal to clone a contract because the id and auto-number will be different).
*For example,
Contract c = [select id from contract where id = 'ABCDEFGHIJ'];
Contract cCopy = c.clone(true, true, true, true);
cCopy.accountId = '0012233445566';
update cCopy;
system.debug('@@@@@@@' + ' ' + cCopy.id);