Variable is not visibleOpportunity Record Type Selection Pageneed a method for json string which contains...

Play Zip, Zap, Zop

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Does Skippy chunky peanut butter contain trans fat?

Why do cars have plastic shrouds over the engine?

Cookies - Should the toggles be on?

In mixed effect models, how account for grouped random effects?

How to make ice magic work from a scientific point of view?

False written accusations not made public - is there law to cover this?

Can you tell from a blurry photo if focus was too close or too far?

Variable is not visible

Workflow Comment popup does not show up

When can a QA tester start his job?

Citing paywalled articles accessed via illegal web sharing

Is Krishna the only avatar among dashavatara who had more than one wife?

What is the difference between rolling more dice versus fewer dice?

Is a new Boolean field better than a null reference when a value can be meaningfully absent?

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?

Why avoid shared user accounts?

Why zero tolerance on nudity in space?

Is it possible to grant users sftp access without shell access? If yes, how is it implemented?

Graph with overlapping labels

What is the purpose of easy combat scenarios that don't need resource expenditure?

Do authors have to be politically correct in article-writing?

Words and Words with "ver-" Prefix



Variable is not visible


Opportunity Record Type Selection Pageneed a method for json string which contains null value and does not contain attributes{ }Apex Trigger: Variable does not existApex REST API to return a Map of Maps?“Variable not visible” error in production, but fine in developmentgetContentAsPDF returning Internal Salesforce.com Error when called from a webserviceField visible to true using apex classSalesforce No_Oauth_State, State not validPost request returns error 405 on ngrokVariable not visible













1















I have this variable which returns key from custom settings. below is the code related to this



  private static String AccLinks {
get {

if (Acclinks == null) {
Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
}
return AccLinks;
}
}


when I run this code, I am getting this error




Variable is not visible: Acc_Class2.Acclinks




Can anyone help me with this










share|improve this question



























    1















    I have this variable which returns key from custom settings. below is the code related to this



      private static String AccLinks {
    get {

    if (Acclinks == null) {
    Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
    AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
    }
    return AccLinks;
    }
    }


    when I run this code, I am getting this error




    Variable is not visible: Acc_Class2.Acclinks




    Can anyone help me with this










    share|improve this question

























      1












      1








      1








      I have this variable which returns key from custom settings. below is the code related to this



        private static String AccLinks {
      get {

      if (Acclinks == null) {
      Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
      AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
      }
      return AccLinks;
      }
      }


      when I run this code, I am getting this error




      Variable is not visible: Acc_Class2.Acclinks




      Can anyone help me with this










      share|improve this question














      I have this variable which returns key from custom settings. below is the code related to this



        private static String AccLinks {
      get {

      if (Acclinks == null) {
      Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
      AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
      }
      return AccLinks;
      }
      }


      when I run this code, I am getting this error




      Variable is not visible: Acc_Class2.Acclinks




      Can anyone help me with this







      apex rest-api apexrest controller-extension custom-controller






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 4 hours ago









      S kanthS kanth

      114




      114






















          2 Answers
          2






          active

          oldest

          votes


















          3














          You cannot assign to a property



          AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');


          if that property does not have a setter method declared. To make the property read-only while caching its value (a lazy-loading pattern), you can synthesize a private setter:



          get {
          // ...
          }
          private set;


          That will allow your class itself to set the value. See Apex Properties for more.






          share|improve this answer































            0














            As mentioned, you cannot set the value to your property when you don't have a setter defined.



            In your case, you instead can use below



            private static String AccLinks { 
            get {
            if (Acclinks == null) {
            Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
            return (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
            }
            }
            }





            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "459"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f251915%2fvariable-is-not-visible%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3














              You cannot assign to a property



              AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');


              if that property does not have a setter method declared. To make the property read-only while caching its value (a lazy-loading pattern), you can synthesize a private setter:



              get {
              // ...
              }
              private set;


              That will allow your class itself to set the value. See Apex Properties for more.






              share|improve this answer




























                3














                You cannot assign to a property



                AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');


                if that property does not have a setter method declared. To make the property read-only while caching its value (a lazy-loading pattern), you can synthesize a private setter:



                get {
                // ...
                }
                private set;


                That will allow your class itself to set the value. See Apex Properties for more.






                share|improve this answer


























                  3












                  3








                  3







                  You cannot assign to a property



                  AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');


                  if that property does not have a setter method declared. To make the property read-only while caching its value (a lazy-loading pattern), you can synthesize a private setter:



                  get {
                  // ...
                  }
                  private set;


                  That will allow your class itself to set the value. See Apex Properties for more.






                  share|improve this answer













                  You cannot assign to a property



                  AccLinks = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');


                  if that property does not have a setter method declared. To make the property read-only while caching its value (a lazy-loading pattern), you can synthesize a private setter:



                  get {
                  // ...
                  }
                  private set;


                  That will allow your class itself to set the value. See Apex Properties for more.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 3 hours ago









                  David ReedDavid Reed

                  36k72154




                  36k72154

























                      0














                      As mentioned, you cannot set the value to your property when you don't have a setter defined.



                      In your case, you instead can use below



                      private static String AccLinks { 
                      get {
                      if (Acclinks == null) {
                      Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
                      return (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
                      }
                      }
                      }





                      share|improve this answer




























                        0














                        As mentioned, you cannot set the value to your property when you don't have a setter defined.



                        In your case, you instead can use below



                        private static String AccLinks { 
                        get {
                        if (Acclinks == null) {
                        Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
                        return (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
                        }
                        }
                        }





                        share|improve this answer


























                          0












                          0








                          0







                          As mentioned, you cannot set the value to your property when you don't have a setter defined.



                          In your case, you instead can use below



                          private static String AccLinks { 
                          get {
                          if (Acclinks == null) {
                          Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
                          return (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
                          }
                          }
                          }





                          share|improve this answer













                          As mentioned, you cannot set the value to your property when you don't have a setter defined.



                          In your case, you instead can use below



                          private static String AccLinks { 
                          get {
                          if (Acclinks == null) {
                          Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
                          return (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
                          }
                          }
                          }






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 3 hours ago









                          Vijay GanjiVijay Ganji

                          819210




                          819210






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Salesforce Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f251915%2fvariable-is-not-visible%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Benedict Cumberbatch Contingut Inicis Debut professional Premis Filmografia bàsica Premis i...

                              Monticle de plataforma Contingut Est de Nord Amèrica Interpretacions Altres cultures Vegeu...

                              Escacs Janus Enllaços externs Menú de navegacióEscacs JanusJanusschachBrainKing.comChessV