Variable is not visibleOpportunity Record Type Selection Pageneed a method for json string which contains...
Would a National Army of mercenaries be a feasible idea?
A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?
Is it a fallacy if someone claims they need an explanation for every word of your argument to the point where they don't understand common terms?
What to do when being responsible for data protection in your lab, yet advice is ignored?
What makes the Forgotten Realms "forgotten"?
Why is working on the same position for more than 15 years not a red flag?
What creature do these Alchemical Humonculus actions target?
Slow moving projectiles from a hand-held weapon - how do they reach the target?
Dilemma of explaining to interviewer that he is the reason for declining second interview
What was the earliest start time of a Catholic mass before 1957?
What kind of hardware implements Fourier transform?
Magento 2 : Call Helper Without Using __construct in Own Module
Typing Amharic inside a math equation?
How do you funnel food off a cutting board?
Do authors have to be politically correct in article-writing?
Word or phrase for showing great skill at something without formal training in it
Can you earn endless XP using a Flameskull and its self-revival feature?
Citing paywalled articles accessed via illegal web sharing
Does fast page mode apply to ROM?
Is there some relative to Dutch word "kijken" in German?
Eww, those bytes are gross
Book where aliens are selecting humans for food consumption
Why would the Pakistan airspace closure cancel flights not headed to Pakistan itself?
How to acknowledge an embarrassing job interview, now that I work directly with the interviewer?
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
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
add a comment |
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
add a comment |
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
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
apex rest-api apexrest controller-extension custom-controller
asked 2 days ago
S kanthS kanth
255
255
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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.
add a comment |
As mentioned, you cannot set the value to your property when you don't have a setter defined.
In your case, you can instead use the below code where you won't be able to set the value for your variable, but you will always get the value from your custom setting record.
private static String AccLinks {
get {
string returnValue = 'some_url'; //you can keep any default value
if (Acclinks == null) {
Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
returnValue = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
}
return returnValue;
}
}
Another option would be to have a private setter using which you can set the value to your variable
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;
} private set;
}
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered 2 days ago
David ReedDavid Reed
36.1k72154
36.1k72154
add a comment |
add a comment |
As mentioned, you cannot set the value to your property when you don't have a setter defined.
In your case, you can instead use the below code where you won't be able to set the value for your variable, but you will always get the value from your custom setting record.
private static String AccLinks {
get {
string returnValue = 'some_url'; //you can keep any default value
if (Acclinks == null) {
Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
returnValue = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
}
return returnValue;
}
}
Another option would be to have a private setter using which you can set the value to your variable
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;
} private set;
}
add a comment |
As mentioned, you cannot set the value to your property when you don't have a setter defined.
In your case, you can instead use the below code where you won't be able to set the value for your variable, but you will always get the value from your custom setting record.
private static String AccLinks {
get {
string returnValue = 'some_url'; //you can keep any default value
if (Acclinks == null) {
Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
returnValue = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
}
return returnValue;
}
}
Another option would be to have a private setter using which you can set the value to your variable
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;
} private set;
}
add a comment |
As mentioned, you cannot set the value to your property when you don't have a setter defined.
In your case, you can instead use the below code where you won't be able to set the value for your variable, but you will always get the value from your custom setting record.
private static String AccLinks {
get {
string returnValue = 'some_url'; //you can keep any default value
if (Acclinks == null) {
Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
returnValue = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
}
return returnValue;
}
}
Another option would be to have a private setter using which you can set the value to your variable
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;
} private set;
}
As mentioned, you cannot set the value to your property when you don't have a setter defined.
In your case, you can instead use the below code where you won't be able to set the value for your variable, but you will always get the value from your custom setting record.
private static String AccLinks {
get {
string returnValue = 'some_url'; //you can keep any default value
if (Acclinks == null) {
Key_Value_List__c kvl = Key_Value_List__c.getInstance('Acc_Content');
returnValue = (kvl != null && kvl.Value__c != null ? kvl.Value__c : 'some_url');
}
return returnValue;
}
}
Another option would be to have a private setter using which you can set the value to your variable
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;
} private set;
}
edited yesterday
answered 2 days ago
Vijay GanjiVijay Ganji
844211
844211
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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