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
mahemahe 

member variable not visible for assignment

Hi , I was trying to fix below issue. can anyone help on this.

Save error: member variable not visible for assignment oppIds = ApexPages.currentPage().getParameters().get( 'id');

 

publicString oppIds

{

get

{

if ( oppIds == null)

{

oppIds = ApexPages.currentPage().getParameters().get( 'id');

}

returnoppIds;

}

 

}

Best Answer chosen by Admin (Salesforce Developers) 
SeAlVaSeAlVa
public String oppIds {
    get {
        if (oppIds == null) {
            oppIds = ApexPages.currentPage().getParameters().get('id');
        }
        return oppIds;
    } private set;
}

 

All Answers

hitesh90hitesh90

Hi,

 

You have to define set property also,

Here, you haven't enabled the property for set, and you're trying to set the value of a property where no set is defined.

 

Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
My Blog:- http://mrjavascript.blogspot.in/

Sagarika RoutSagarika Rout

Please try below

 

    

publicString oppIds

{

   set

   {

    if ( oppIds == null)

    {

       oppIds = ApexPages.currentPage().getParameters().get( 'id');

    }

 }

 get

{

  returnoppIds;

}

}

SeAlVaSeAlVa
public String oppIds {
    get {
        if (oppIds == null) {
            oppIds = ApexPages.currentPage().getParameters().get('id');
        }
        return oppIds;
    } private set;
}

 

This was selected as the best answer