You need to sign in to do that
Don't have an account?
Ash Jones 10
I need an Apex class with my trigger to avoid the 0% code coverage error
Hello All,
I have a very basic trigger in sandbox which i want to push it through the production. Without the test class i am getting the 0% code coverage error. Can someone please help me with this?
My Trigger: Order__c (Custom object), i want to update the OwnerId with the value in custome field Owner_Id__c.
trigger UpdateOwner on Orders__c (before insert) {
for (Orders__C a : Trigger.New) {
a.OwnerId = a.Owner_Id__c;
}
}
Thanks.
I have a very basic trigger in sandbox which i want to push it through the production. Without the test class i am getting the 0% code coverage error. Can someone please help me with this?
My Trigger: Order__c (Custom object), i want to update the OwnerId with the value in custome field Owner_Id__c.
trigger UpdateOwner on Orders__c (before insert) {
for (Orders__C a : Trigger.New) {
a.OwnerId = a.Owner_Id__c;
}
}
Thanks.
I order to achieve something without code we need to use configuration aspect of salesforce. In this case we don't require Test Classes. I hope inorder to achieve this requirement Workflow Field update and Process builder would work.
PLease mark as best answer if helped and Mark as best answer if helped for others help.
Regards,
Ramakant
I can not change the OwnerId field with process builder or workflow rule. That is why i looked into trigger.