Vous êtes sur la page 1sur 2

<h2>Problem</h2>

002
003
<p>One of the greatest features provided by Force.com Sites is the ability to de
velop simple, externally facing web forms that can submit directly to a record i
n Salesforce.</p>
004
005
<p>An example use case for this is a form that allows a user to submit a Case, p
roviding their contact information along with a description of their problem. Be
cause users may frequent the form to submit their issues, collecting their conta
ct information and storing it in a cookie can make future submissions much more
quick and convenient.</p>
006
007
<p>Apex provides a standard 'Cookie' class that can store this data, however the
re is a significant limitation: cookie values can only be set in a <b>constructo
r</b>. This makes setting page cookies difficult because the constructor is exec
uted before the form values are supplied by the user.</p>
008
009
<h2>Solution</h2>
010
011
<p>By setting the cookies using an <i>inner class</i>, the form values can be st
ored upon submission, then easily retrieved when the page is visited on future s
ubmissions.</p>
012
013
<p>The following code sample shows how you can build a 'Cookie Jar' class
<h2>Problem</h2>
002
003
<p>One of the greatest features provided by Force.com Sites is the ability to de
velop simple, externally facing web forms that can submit directly to a record i
n Salesforce.</p>
004
005
<p>An example use case for this is a form that allows a user to submit a Case, p
roviding their contact information along with a description of their problem. Be
cause users may frequent the form to submit their issues, collecting their conta
ct information and storing it in a cookie can make future submissions much more
quick and convenient.</p>
006
007
<p>Apex provides a standard 'Cookie' class that can store this data, however the
re is a significant limitation: cookie values can only be set in a <b>constructo
r</b>. This makes setting page cookies difficult because the constructor is exec
uted before the form values are supplied by the user.</p>
008

009
<h2>Solution</h2>
010
011
<p>By setting the cookies using an <i>inner class</i>, the form values can be st
ored upon submission, then easily retrieved when the page is visited on future s
ubmissions.</p>
012
013
<p>The following code sample shows how you can build a 'Cookie Jar' class
<h2>Problem</h2>
002
003
<p>One of the greatest features provided by Force.com Sites is the ability to de
velop simple, externally facing web forms that can submit directly to a record i
n Salesforce.</p>
004
005
<p>An example use case for this is a form that allows a user to submit a Case, p
roviding their contact information along with a description of their problem. Be
cause users may frequent the form to submit their issues, collecting their conta
ct information and storing it in a cookie can make future submissions much more
quick and convenient.</p>
006
007
<p>Apex provides a standard 'Cookie' class that can store this data, however the
re is a significant limitation: cookie values can only be set in a <b>constructo
r</b>. This makes setting page cookies difficult because the constructor is exec
uted before the form values are supplied by the user.</p>
008
009
<h2>Solution</h2>
010
011
<p>By setting the cookies using an <i>inner class</i>, the form values can be st
ored upon submission, then easily retrieved when the page is visited on future s
ubmissions.</p>
012
013
<p>The following code sample shows how you can build a 'Cookie Jar' class

Vous aimerez peut-être aussi