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
Sachin10Sachin10 

Use Visualforce Page in WebtoCase

I have a Visualforce Page with standardController(Case) & Extensions

Can we use this Visualforce Page in WebtoCase?
I would like to have this VisualforcePage in my Company's Website.

Any poniters are welcome.
Many Thanks

AshwaniAshwani
If your company website is hosted on Force.com sites then you can use visualforce page. Else, webtocase is not more than a html form you can use it anywhere. Visualforce page is platform dependent.
Sachin10Sachin10
@Reid Thanks for your reply.
I'm not sure if my company website is hosted on Force.com sites.
How can do it using sites?

If I have to create using HTML form I need to use lot of styling and other things which I'm not familiar with.
So would like to find a way to integrate the Visualforce Page in my website, which will create the case in salesforce based upon my controller logic
AshwaniAshwani
Sachin,

There is no simple way to integrate controller with external application but you can do one thing.

You can write a trigger on Case object. When a new case is entered by web2case from company site, that trigger will fire on before insert and you can perform the controller logic there. You will have access to all fields of that case record.
bob_buzzardbob_buzzard
You can't use your Visualforce page on the standard web to case form, as that submits to a generic Salesforce servlet rather than Visualforce.  What you can to is expose your page via an unauthenticated Force.com site and then add this to your company website via an iframe.  We've done this for a number of customers - one example can be found at:

http://www.heathrowairport.com/help/contact-us/feedback

We had to use a Visualforce page for this as the form is collecting information on a variety of issues.
Sachin10Sachin10
@Bob Thanks for your reply.
I have created a Site and added my Visualforce Pages.
can you please post some sample code on how to add it to via iframe?

Many thanks in advance :)
bob_buzzardbob_buzzard
In your company web site you'll need something like:

<iframe src="<your VF site page>" />

You can find out more about the iframe tag at:

https://developer.mozilla.org/en/docs/Web/HTML/Element/iframe
Sachin10Sachin10
@bob thanks for your reply

What should I put under SRC.

My Site Url is "http://sandboxname-casemanagement.cs8.force.com/"
My VF Page name is "webtoCaseManagement"

Now my iframe would be 
<ifrmae src="http://sandboxname-casemanagement.cs8.force.com/webtoCaseManagement" />

Please correct me if i'm wrong.

Really Appreciate your help
bob_buzzardbob_buzzard
Correct. As long as you can view that URL through a regular browser, the iframe will be rendered.