0

Email-to-Case functionality has been stopped for a while due to some issue in our Org. Inbetween the time the Case was not created in the Salesforce. We received all the emails as errors in our mailbox and wanted to attach them to the relevant Case.

Error msg:

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : CaseTrigger: execution of AfterInsert

caused by: System.DmlException: Update failed. First exception on row 0 with id 5004a000008GWGgAAO; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Cases in queue cannot be modified.: []

Class.CaseTriggerHandler.updateCaseQueue: line 132, column 1 Trigger.CaseTrigger: line 250, column 1

From: [email protected](Sam yuk) Sent: Wed May 18 04:26:09 GMT 2022 To: [[email protected]] Subject: test case- ASAP assist -

1
  • if(owner.startsWith('00G') && userDetails.UserRole != null && !userDetails.UserRole.Name.contains(ESCommonprofile.get('Role_Lead').Role__c) && !(userDetails.Profile.Name.contains(ESCommonprofile.get('Profile_Admin').Role__c)|| userDetails.Profile.Name.contains(ESCommonprofile.get('Profile_Integration').Role__c)) && Trigger.oldMap.get(caseObj.id).OwnerId == Trigger.newMap.get(caseObj.id).OwnerId && !Test.isRunningTest()){ caseObj.addError('Cases in queue cannot be modified.');
    – Tom
    May 19, 2022 at 4:06

2 Answers 2

1

You seem to have a validation rule on Case that is getting violated. Please check validation rules on case with the message "Cases in queue cannot be modified". Please post the formula used in these validation rules.

1

Please check any custom validations you have setup in recent times on the Case Object. Disable those and test the flow.

If the business needs those validation, try provide additional exceptions to bypass the validation for EmailToCase scenarios.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .