Issue when using JSENCODE
up vote
1
down vote
favorite
When I use the JSENCODE
I have the following issue:
var accRegNumber = "{!Account.Registration_Number__c}";
var accName = "{!Account.Name}";
var accType = "{!Account.Custom_Filed_Type__c}";
var accRate = "{!Account.Custom_Filed_Rate__c}";
var accId = "{!Account.Id}";
accRegNumber = {!JSENCODE(accRegNumber)};
accName = {!JSENCODE(accName)};
accType = {!JSENCODE(accType)};
accRate = {!JSENCODE(accRate)};
accId = {!JSENCODE(accId)};
Error: Field accRegNumber does not exist. Check spelling.
Could you please advise why adding {!JSENCODE(accRegNumber)};
to accRegNumber
variable is giving an error message?
javascript error-messages
add a comment |
up vote
1
down vote
favorite
When I use the JSENCODE
I have the following issue:
var accRegNumber = "{!Account.Registration_Number__c}";
var accName = "{!Account.Name}";
var accType = "{!Account.Custom_Filed_Type__c}";
var accRate = "{!Account.Custom_Filed_Rate__c}";
var accId = "{!Account.Id}";
accRegNumber = {!JSENCODE(accRegNumber)};
accName = {!JSENCODE(accName)};
accType = {!JSENCODE(accType)};
accRate = {!JSENCODE(accRate)};
accId = {!JSENCODE(accId)};
Error: Field accRegNumber does not exist. Check spelling.
Could you please advise why adding {!JSENCODE(accRegNumber)};
to accRegNumber
variable is giving an error message?
javascript error-messages
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
When I use the JSENCODE
I have the following issue:
var accRegNumber = "{!Account.Registration_Number__c}";
var accName = "{!Account.Name}";
var accType = "{!Account.Custom_Filed_Type__c}";
var accRate = "{!Account.Custom_Filed_Rate__c}";
var accId = "{!Account.Id}";
accRegNumber = {!JSENCODE(accRegNumber)};
accName = {!JSENCODE(accName)};
accType = {!JSENCODE(accType)};
accRate = {!JSENCODE(accRate)};
accId = {!JSENCODE(accId)};
Error: Field accRegNumber does not exist. Check spelling.
Could you please advise why adding {!JSENCODE(accRegNumber)};
to accRegNumber
variable is giving an error message?
javascript error-messages
When I use the JSENCODE
I have the following issue:
var accRegNumber = "{!Account.Registration_Number__c}";
var accName = "{!Account.Name}";
var accType = "{!Account.Custom_Filed_Type__c}";
var accRate = "{!Account.Custom_Filed_Rate__c}";
var accId = "{!Account.Id}";
accRegNumber = {!JSENCODE(accRegNumber)};
accName = {!JSENCODE(accName)};
accType = {!JSENCODE(accType)};
accRate = {!JSENCODE(accRate)};
accId = {!JSENCODE(accId)};
Error: Field accRegNumber does not exist. Check spelling.
Could you please advise why adding {!JSENCODE(accRegNumber)};
to accRegNumber
variable is giving an error message?
javascript error-messages
javascript error-messages
asked Dec 3 at 13:56
lemdev
698
698
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
accRegNumber
is a JavaScript variable. The Salesforce formula expression {!JSENCODE(accRegNumber)}
is processed by the server long before the content reaches the JavaScript parser, and the server doesn't know anything about the JavaScript variables you're creating.
You need to write the formula as part of the original assignment:
var accRegNumber = "{!JSENCODE(Account.Registration_Number__c)}";
Wowie, thats good catch, I never found any documentation for this
– Pranay Jaiswal
Dec 3 at 14:21
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%2f241225%2fissue-when-using-jsencode%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
accRegNumber
is a JavaScript variable. The Salesforce formula expression {!JSENCODE(accRegNumber)}
is processed by the server long before the content reaches the JavaScript parser, and the server doesn't know anything about the JavaScript variables you're creating.
You need to write the formula as part of the original assignment:
var accRegNumber = "{!JSENCODE(Account.Registration_Number__c)}";
Wowie, thats good catch, I never found any documentation for this
– Pranay Jaiswal
Dec 3 at 14:21
add a comment |
up vote
5
down vote
accepted
accRegNumber
is a JavaScript variable. The Salesforce formula expression {!JSENCODE(accRegNumber)}
is processed by the server long before the content reaches the JavaScript parser, and the server doesn't know anything about the JavaScript variables you're creating.
You need to write the formula as part of the original assignment:
var accRegNumber = "{!JSENCODE(Account.Registration_Number__c)}";
Wowie, thats good catch, I never found any documentation for this
– Pranay Jaiswal
Dec 3 at 14:21
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
accRegNumber
is a JavaScript variable. The Salesforce formula expression {!JSENCODE(accRegNumber)}
is processed by the server long before the content reaches the JavaScript parser, and the server doesn't know anything about the JavaScript variables you're creating.
You need to write the formula as part of the original assignment:
var accRegNumber = "{!JSENCODE(Account.Registration_Number__c)}";
accRegNumber
is a JavaScript variable. The Salesforce formula expression {!JSENCODE(accRegNumber)}
is processed by the server long before the content reaches the JavaScript parser, and the server doesn't know anything about the JavaScript variables you're creating.
You need to write the formula as part of the original assignment:
var accRegNumber = "{!JSENCODE(Account.Registration_Number__c)}";
answered Dec 3 at 14:04
David Reed
28.9k61746
28.9k61746
Wowie, thats good catch, I never found any documentation for this
– Pranay Jaiswal
Dec 3 at 14:21
add a comment |
Wowie, thats good catch, I never found any documentation for this
– Pranay Jaiswal
Dec 3 at 14:21
Wowie, thats good catch, I never found any documentation for this
– Pranay Jaiswal
Dec 3 at 14:21
Wowie, thats good catch, I never found any documentation for this
– Pranay Jaiswal
Dec 3 at 14:21
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f241225%2fissue-when-using-jsencode%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