I am working on portal community and created link with tag for user to search.All of them success instead for tag named 'Debit & Credit'.I suspected it is due to '&' because when I remove '&' it works.I tried to replace '&' with the %26 and & as below but none of them works.

 <li><apex:outputLink value="/apex/MyPortal_Category_Vf?Tags=%22Financial Management%22,%22Debit & Credit%22">Debit &amp; Credit</apex:outputLink></li> //Fail
 <li><apex:outputLink value="/apex/MyPortal_Category_Vf?Tags=%22Financial Management%22,%22Debit &amp; Credit%22">Debits &amp; Credit</apex:outputLink></li>// Fail
 <li><apex:outputLink value="/apex/MyPortal_Category_Vf?Tags=%22Financial Management%22,%22Debit%20%26%20Credit%22"> //Fail

The success page will look like this: enter image description here

The fail page is look like this : enter image description here

I tried to capture in debug log as below but nothing.No exception has been thrown.

06:12:49.0 (461069)|USER_INFO|[EXTERNAL]|005260000016xsE|portaluser@myportal.com|Greenwich Mean Time|GMT+01:00
06:12:49.0 (500985)|EXECUTION_STARTED
06:12:49.0 (506009)|CODE_UNIT_STARTED|[EXTERNAL]|066260000004gCG|VF: /apex/MyPortal_Category_Vf
06:12:49.53 (53007801)|CUMULATIVE_LIMIT_USAGE
06:12:49.53 (53007801)|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 100
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 50
  Number of queueable jobs added to the queue: 0 out of 50
  Number of Mobile Apex push calls: 0 out of 10

06:12:49.53 (53007801)|CUMULATIVE_LIMIT_USAGE_END

06:12:49.0 (53060382)|CODE_UNIT_FINISHED|VF: /apex/MyPortal_Category_Vf
06:12:49.0 (54259004)|EXECUTION_FINISHED

Is there any way to include '&' in tag?

  • Try replacing & with %26 in the outputLink value – highfive Aug 15 '16 at 5:36
  • I tried <apex:outputLink value="/apex/MyPortal_Category_Vf?Tags=%22Financial Management%22,%22Debit%20%26%20Credit%22"> and it fails. – unidha Aug 15 '16 at 5:38
  • may be you might have to post any debug log entry when you trying to access the link. so that people can look if any malformed url pattern has generated. Also try to access the link directly without generating through apex and check if it works – highfive Aug 15 '16 at 5:47
  • Can you check the logic where you apply the pageMessage as an error has occurred ? – highfive Aug 15 '16 at 5:53
  • I could not find where the page error display but this the URL pattern of the page that display error portal.force.com/partners/sfc/… .Notice the ampersand is truncated and the page is seem standard salesforce page to me. – unidha Aug 15 '16 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.