1

i am creating a HTML area Home page layout component.my code is

<?xml version="1.0" encoding="UTF-8"?>
<HomePageComponent xmlns="http://soap.sforce.com/2006/04/metadata">
    <body>&lt;div id=&quot;demoContainer&quot;&gt;&amp;nbsp;&lt;script type=&quot;text/javascript&quot;&gt;        try{  var pa=document.getElementById(&quot;demoContainer&quot;).parentNode.parentNode;                 pa.style.display = &quot;none&quot;;                }              catch(err){             alert(&apos;There was an error on this webpage=&apos;+err.description);        } &lt;/script&gt;nbsp;&lt;script type=&quot;text/javascript&quot; src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js&quot; &gt;&lt;/script&gt;  &lt;script type=&quot;text/javascript&quot;&gt;   
    window.onload = function(){
        var actionLinks = document.getElementById("PendingProcessWorkitemsList_body").getElementsByClassName('actionLink');
    var i;
    for(i = 0; i< actionLinks.length ; i++)
      var text = accountLinks[i].textContent || accountLink[i].innerText;
      if(text == 'Approve / Reject')
          accountLinks[i].setAttribute('href','/apex/firstPage');
    }

          &lt;/script&gt;   &lt;/div&gt;</body>
    <pageComponentType>htmlArea</pageComponentType>
    <width>wide</width>
</HomePageComponent>

and when i try to save it .it is giving me error

The content of elements must consist of well-formed character data or markup.   Override.homePageComponent  /Custom Approval Process/src/homePageComponents line 7  Force.com save problem

error is in for loop Line 7 is of for loop

  • 1
    on line 7 i < actionLinks is working as html markup not script and it is unable to find closing >. This is happening beacause of html encoding you have done. – Ashwani Oct 18 '13 at 9:27
  • Ok. I have posted it as solution. @user133421 – Ashwani Oct 18 '13 at 9:38
3

On line 7 i < actionLinks is working as html markup not script and it is unable to find closing >. This is happening because of html encoding you have done.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.