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
joestuartjoestuart 

setting the access on my new class and object (oppertunites) accessible on my web page

Hi I have just successfuly made my Class that checks a custom field in oppertunities, saves the object and then redirects to a thankyou page.  

I have tested it and I got 100% code coverage and when I test the page (logged in to salesforce) it works perfectly but when I test it on the public site, the VF pages work but when I click on the submit button it just reloads the page and dosen't fire off the class.  

I have added the VF pages to my web profile and the class too but I think there is still somthing that I need to do to make the class public....  I think it is something to do with the access of the APEX class.

Thank you.

Here is my class FYI

public class proteusProposalCon {
private ApexPages.StandardController controller;
public proteusProposalCon(ApexPages.StandardController controller) {
this.controller = controller;
}

  public PageReference saveAndCongrat() {
  controller.save(); // This takes care of the details for you.
  PageReference congratsPage = Page.thankyou;
  congratsPage.setRedirect(true);
  return congratsPage;
}
}
Virendra ChouhanVirendra Chouhan
Hi joestuart,

Try changing the access modifier of class to Global.
I hope this will help.
Let me know if this helped.

Regards
Virendra
joestuartjoestuart
Thank you for the response, where can I change the access modifier? Is it click or code? Thank you.
Virendra ChouhanVirendra Chouhan
Hi joestuart,

Go to Setup-> Develop - > Apex Class -> click on your class name (proteusProposalCon)
then click on edit

and relapce public to Global.

Regards
Virendra

joestuartjoestuart
Hi Virendra, Thank you, I have gone in and changed the public to Global and it didn't fix it so I changed all of the publics to global but it didn't fix it either. My new code. There is a private on the second line, could that be the issue? Thank you again. global class proteusProposalCon { private ApexPages.StandardController controller; global proteusProposalCon(ApexPages.StandardController controller) { this.controller = controller; } global PageReference saveAndCongrat() { controller.save(); // This takes care of the details for you. PageReference congratsPage = Page.thankyou; congratsPage.setRedirect(true); return congratsPage; } } Kind regards, Virendra Chouhan replied to your question at 5:12 AM on 8/5/2014. Original question: Hi I have just successfuly made my Class that checks a custom field in oppertunities, saves the object and then redirects to a thankyou page. I have tested it and I got 100% code coverage and when I test the page (logged in to salesforce) it works perfectly but when I test it on the public site, the VF pages work but when I click on the submit button it just reloads the page and dosen't fire off the class. I have added the VF pages to my web profile and the class too but I think there is still somthing that I need to do to make the class public.... I think it is something to do with the access of the APEX class. Thank you. Here is my class FYI public class proteusProposalCon { private ApexPages.StandardController controller; public proteusProposalCon(ApexPages.StandardController controller) { this.controller = controller; } public PageReference saveAndCongrat() { controller.save(); // This takes care of the details for you. PageReference congratsPage = Page.thankyou; congratsPage.setRedirect(true); return congratsPage; } } Reply: Hi joestuart, Go to Setup-> Develop - > Apex Class -> click on your class name (proteusProposalCon) then click on edit and relapce public to Global. Regards Virendra Tip! To respond, either reply to this email or click this link: https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AeEl
Virendra ChouhanVirendra Chouhan
Hi joestuart,

Now i create the same thing.
and its work fine.
no need to replace public to global.

1. Add both VF pages on site's detail page
2. Add on Public Access Setting button on site's detail page and make sure that your opportunity object have all the permisions which you want.
    like if you want to create opportunity then this profile have create permision.

That's all 

Regards
Virendra
joestuartjoestuart
 Standard objects
Hi Virendra,  Sorry about the late response, I have been away.

Thank you for your help.  I have added the VF pages but there isn't a check box for edit on opportunities.  I need public to be able to edit.

Thank you.