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
Akash jena 3Akash jena 3 

variable doesn't exist issue

i have written this test class but I am getting error like this
public class SplitTriggerTest {
    Public static void split(){
        Account acc = new Account();
        acc.Name = 'Test Account1';
           insert acc;
        Equipment__c eqp = new Equipment__c();
        eqp.Name = 'E1';
        eqp.Category__c = 'B';
        insert eqp;
        Opportunity__c opp = new Opportunity__c();
        opp.Opportunity_Name__c = 'Test A';
        opp.Stage__c = 'Prospect';
        opp.CommercialFrom__c = 'Rent Alpha Private Limited';
        opp.Account__c =;
        insert opp;
        Opportunity_Product__c op = new Opportunity_Product__c();
        op.Equipment__c =; 
        op.Opportunity__c =;
        op.Tenure_in_months__c = 1234;
        insert op;
        Split__c sp = new Split__c();
        sp.Amount__c = 1234;
        sp.Reason_for_Loss__c = 'Competition';
        sp.Competitor__c = 'Hewlett Packard';
        sp.Offer_Equipment__c =;
        insert sp;       
    Private static void splitamount(){
        Split__c spl = [Select id, Name from Split__c Limit 1];
        apexpages.StandardController sc = new apexpages.StandardController(sp);
        SplitTrigger c = new SplitTrigger(sc);

User-added image
ShirishaShirisha (Salesforce Developers) 
Hi Akash,


Seems like the variable has defined in some other method due to which you are not able to pass the variable to the VF page.


Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Akash jena 3Akash jena 3
how to fix that error