• Galia
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I created 2 different visualforce pages, one in which you set a cookie and another that is using the cookie (both using JavaScript).

When testing the 2 pages, opening using /apex/page, all works correctly.

When placing the login page in the sidebar and the other page in the case layout, the cookie doesn't seem to pass from the sidebar page to the case page.

 

This is the page in which I set the cookie:

 

<apex:page standardStylesheets="false" sidebar="false" showHeader="false">

<apex:includeScript value="{!$Resource.LPAloginFunctions}"/>

<apex:form >

User: <input name="lpaUser" id="lpaUser" type="text" value=""></input><br/>

Pass: <input name="lpaPass" id="lpaPass" type="password" value=""></input>

<p>

<input type="button" value="Log in" id="signIn" name="signIn" onclick = "submitLoginCredentials()"></input>

<input type="button" value="Delete Cookie" id="delCookie" name="delCookie" onclick = "deleteLpaCookies()"></input><br/>

</p>               

<script type="text/javascript">        

var mydomain=window.location.hostname;       

document.write(mydomain);              

var cookieValue = getCookie('lpaUser') ;        

document.write(cookieValue);          

if(cookieValue  == '' || cookieValue.toString() == "undefined" ){              

document.getElementById("lpaUser").value = "ENTER USER NAME";        

}          

else{              

document.getElementById("lpaUser").value = getCookie('lpaUser') ;              

document.getElementById("lpaPass").value = getCookie('lpaPass');          

}

</script>    

</apex:form>    

</apex:page>

 

This is part of the page in which I get the cookie:

 

<script type="text/javascript">         

var cookieValue = getCookie('lpaUser') ;          

if(cookieValue  == '' || cookieValue.toString() == "undefined" ){              

document.getElementById("lpaUser").value = "ENTER USER NAME";          

}          

else{              

document.getElementById("lpaUser").value = getCookie('lpaUser') ;              

document.getElementById("lpaPass").value = getCookie('lpaPass');          

}

</script>

 

How can I use a cookie set in the sidebar page, in the case layout page?

 

Thanks!

  • October 16, 2011
  • Like
  • 0

Hi,

 

I'm working on a trigger that should send an email to a contact when an event is created on the salesforce calendar.

We are using a VF email template which is related to events. The problem is that we would like to send information related to the event in the email to the contact.

 

If we try "email.setwhatId(event.Id);"

 

We get the following error:

"First exception on row 0; first error: INVALID_ID_FIELD, Only accounts, assets, campaigns, cases, contracts, opportunities, orders, products, solutions and custom objects are allowed as whatId.: "

 

What is the right way to do this? The whole purpose of this trigger is to notify the contact with the details of the agreed meeting after setting it up.

 

Best

 

Tzuvy

  • February 02, 2012
  • Like
  • 0