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
satya G 4satya G 4 

How to test coverage for this code

i insert opportunity and related records between start and stop test:again i update the opp record eventhough the below code is not covered.

 if (trigger.isUpdate)
            {
                System.debug('>>>>>>>>>>trigger.old[i].StageName>>>>>>>>>>>'+trigger.old[i].StageName);
                if (trigger.old[i].StageName.equalsIgnoreCase('Awarded'))
                    alreadyInvited=true;
                
                if (trigger.old[i].Organization_Update_Received__c==true)
                    alreadyFormReceived=true;
            }

 
Jasper WallJasper Wall
Hi Satya,
May be it is the cause of System.DMLException due to failure of insertion or updation of your records. Check once your Debug log.

Thanks,
Balayesu
satya G 4satya G 4
Hi Balayesu,
 Thanks for your reply.i currectly insert the record on opprt and update with  above fields,i didnt not get the code coverage..