function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VSUVSU 

Unable to mass transfer accounts - Apex trigger error

Im gettting the below error when trying to mass trasnfer accounts from an old user to a new user. Im new to APEX, hence any advise is appreciated.

User-added image

User-added image
Best Answer chosen by VSU
Steven NsubugaSteven Nsubuga
There is a Look Up Filter on the Contact object, Lead_Source_Auto2, possibly on the ACP_ManagerID__c field, that is not being met in your code. You need to fix that.
Lastly in case you bulk transfer more than 50 records, you will likely hit a governor limit. Salesforce will throw a limit exception because your trigger is not bulkified. Fix the filter issue first.

All Answers

Steven NsubugaSteven Nsubuga
You need to share with us the ComUser apex class as well.
VSUVSU
User-added image
Steven NsubugaSteven Nsubuga
There is a Look Up Filter on the Contact object, Lead_Source_Auto2, possibly on the ACP_ManagerID__c field, that is not being met in your code. You need to fix that.
Lastly in case you bulk transfer more than 50 records, you will likely hit a governor limit. Salesforce will throw a limit exception because your trigger is not bulkified. Fix the filter issue first.
This was selected as the best answer
VSUVSU
Thanks Steven. Il work on having the code fixed first.