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
677
677
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 |
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
28k61746
28k61746
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