function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sfdc11Sfdc11 

How to Add Parameter in hte Force.com Sites!!!

 

 

Can we add a parameter in the Force.com site URL...

 

Help me out pls If anybody worked on this..

Sfdc11Sfdc11

Say For eg,

SiteURL?model=xyz

Avidev9Avidev9
Well definitely you can add them!
But can you elaborate on the Use Case ?
Ashish_SFDCAshish_SFDC

Hi Kavi, 

 

Yes, you can do it with <apex: param> tag. But you have to use this with an outputLink, outputText, actionFunction, actionSupport, commandLink, or commandButton component.

 

following is an example.

 

<apex:page>

        <apex:outputLink>

              Click me

          <apex:param name="myParam" value="myValue"/>

      </apex:outputLink>

</apex:page> 

 

See the link for more info,

http://developer.force.com/cookbook/recipe/using-query-string-parameters-in-a-visualforce-page

 

 

Regards,

Ashish

 

Sfdc11Sfdc11

Here is requirement:

I've created one VF page with HTML+JS ,made it as Force.com sites:

 

http://companyname.stag.cs3.force.com/pgname

 

 

I want to set/store the param into SFDC field.

say for eg, I need like below

 

http://companyname.stag.cs3.force.com/pgname?model=xyz

 

I'll get the xyz from VF page and strore into SFDC custom field...

 

Help me out!!

Ashish_SFDCAshish_SFDC

Hi Kavi, 

 

You can use th REST API call to get the query based and post it on the URL. 

To explore REST API you can use the https://workbench.developerforce.com/login.php go to Utilities -> REST EXPLORER

And the REST API URL can be queried like the example below,

https://ap1.salesforce.com/services/data/v28.0/query?q=select+id,name+from+contact+where+Account.ID+=+'0019000000Bsbp8'

 

See below links for more information,

http://wiki.developerforce.com/page/Creating_REST_APIs_using_Apex_REST

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_rest_code_sample_basic.htm

 

Regards,
Ashish