0

I have Apex class:

public class myController {
    public string url{
        get {
            if (this.url == null)
                this.url = System.URL.getSalesforceBaseUrl().toExternalForm();
            return this.url; }
        set;
        }

}

for this I have Create the Visual force Component

<apex:component controller="myController" access="global">
  <p />
  <apex:outputLink id="urlString" value="{!url}/{!$User.Id}**/?noredirect=1&isUserEntityOverride=1**" >{!url}/{!$User.Id}**/?noredirect=1&isUserEntityOverride=1**</apex:outputLink>
</apex:component>

when I am trying to add the ?noredirect=1&isUserEntityOverride=1 line Manually in Url:

it is showing Error:

Error: URL line 3, column 157: The reference to entity "isUserEntityOverride" must end with the ';' delimiter Error Error: The reference to entity "isUserEntityOverride" must end with the ';' delimiter.

How to Rectify the Error,Please Anyone Guide me for the Answer,How to add that line Manually in the Component

3
  • try with this value="{!url}/{!$User.Id}?noredirect=1&isUserEntityOverride=1" Oct 27, 2016 at 9:33
  • after trying that value:Error: URL line 3, column 157: The reference to entity "isUserEntityOverride" must end with the ';' delimiter Error Error: The reference to entity "isUserEntityOverride" must end with the ';' delimiter.@TusharSharma
    – SFDC
    Oct 27, 2016 at 9:36
  • @TusharSharma what i am doing Mistake
    – SFDC
    Oct 27, 2016 at 9:40

1 Answer 1

2

You do need to change & to &amp; This will solve your problem.

<apex:component access="global">
  <p />
  <apex:outputLink id="urlString" value="{!url}/{!$User.Id}?noredirect=1&isUserEntityOverride=1" >{!url}/{!$User.Id}?isUserEntityOverride=1&amp;noredirect=1</apex:outputLink>
</apex:component>

When you add & SF Compiler take this as and search for line end statement. If you want to print&sign then you need to htmlencode this as thats why we use &amp;

2
  • can you explain the Logic,How you are done@tushar sharma
    – SFDC
    Nov 1, 2016 at 5:09
  • @user36188 check my updated answer Nov 1, 2016 at 5:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .