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
G Ramakrishna 4G 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: []
JAGDISH MOREJAGDISH MORE
Hello devin cafr,
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 .