You need to sign in to do that
Don't have an account?
G Ramakrishna 4
I am not able to insert the record in Test class
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTemplatesTrigger: execution of AfterInsert
caused by: ahm.fflib_SObjectDomain.DomainException: Permission to create an AccountTemplete denied.
Class.ahm.fflib_SObjectDomain.handleAfterInsert: line 212, column 1
Class.ahm.fflib_SObjectDomain: line 377, column 1
Class.ahm.fflib_SObjectDomain.triggerHandler: line 330, column 1
Trigger.AccountTemplateTrigger: line 14, column 1: []
caused by: ahm.fflib_SObjectDomain.DomainException: Permission to create an AccountTemplete denied.
Class.ahm.fflib_SObjectDomain.handleAfterInsert: line 212, column 1
Class.ahm.fflib_SObjectDomain: line 377, column 1
Class.ahm.fflib_SObjectDomain.triggerHandler: line 330, column 1
Trigger.AccountTemplateTrigger: line 14, column 1: []
While doing dml operation in domain layer class ahm you should do System.runas(User) using that user, Who is having permission for read/create AccountTemplate in your org. I think then your issue will get resolve.
If this resolves your issue please mark it .