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
sridhar sridharsridhar sridhar 

code coverage for Auto Populate one object field values into another object

Hi,

Can anybody help me on this please.
I have two custom objects.1) Fund 2) Refund
 
have 15  custom fields on both objects   like i) Primary_value__C ii) Primary_1_value__C
we have writtern a chandler class which is calling  on before update trigger. 
class is working ,Handler class code snippet: 
a.Primary_value__C  = b.Primary_1_value__C ; 
a.Inventory_price__C = b.Inventory_1_value__C;
a.Monthly_val_c = b.Monthly_1_val__c;
.
.
.
.
.
But, 
i am facing code coverge issue for all mapped fields, remaining whole class getting code coverage. 
In test class i initiated two objects and passed values for all the fields and inserted, still unable to code coverage for those 15 mapped fields. so i am getting only 54% code coverage which is creatig deploymet problem. 

How can i come out of this problem?? 

 
Ashish KumarAshish Kumar
Hi Sridhar,

From your words, i could assume that you need to update the records to cover the class because the handler is on before update trigger.
For detailed help, Could you please paste code of the handler class.

Regards,
Ashish Kr.