0

When clicking on my custom on Event standard layout I have an 'invalid left-hand assignment' error.

My code below :

{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}

IF( "{!Event.Visit_Report__c}" = ""){
window.location.href = "/a0q/e?CF00N57000006QHL4=
{!Account.Name}&CF00N57000006QHL4_lkid=
{!Event.What}&ent=01I57000000Oz9K&00N57000006QHKk=
{!Event.Subject}&retURL=%2F{!Event.Id}&00N57000006QHKu=
{!DATETIMEVALUE(Event.StartDateTime )}&00N57000006QHKz=https://xxx.cs81.my.salesforce.com/{!Event.Id}" ;}

else 
{
alert( 'VR exits on this record' );
}
1
  • If should be in lower case and it accepts a condition instead of assignment. Replace = with ==
    – Raul
    Dec 1, 2017 at 8:50

1 Answer 1

0

There are two errors in your code first JavaScript is case sensitive so you need if instead of IF. Second is you need to use equals == while you are using assignment = operator. Check the updated code.

if( "{!Event.Visit_Report__c}" == ""){
     window.location.href = "/a0q/e?CF00N57000006QHL4={!Account.Name}&CF00N57000006QHL4_lkid={!Event.What}&ent=01I57000000Oz9K&00N57000006QHKk={!Event.Subject}&retURL=%2F{!Event.Id}&00N57000006QHKu={!DATETIMEVALUE(Event.StartDateTime )}&00N57000006QHKz=https://xxx.cs81.my.salesforce.com/{!Event.Id}" ;
}
else 
{
      alert( 'VR exits on this record' );
}

You must log in to answer this question.

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