SalesforceLabs / survey-force

86 stars 62 forks source link

Survey Requires a Salesforce Login? #170

Open DaveWV opened 8 months ago

DaveWV commented 8 months ago

Describe the bug We're testing Survey Force in our Sandbox environment and have so far successfully created our own simple survey. It seems that we can only take the survey if we have Salesforce credentials. Is this because we're testing in Sandbox or are we distributing the URL incorrectly?

To Reproduce The URL at https://wevideo--frcar--c.sandbox.vf.force.com/apex/takesurvey?id=a4LE20000001czJMAQ&cId=none&caId=none will request a login. If we supply login credentials, we can complete the survey. If we don't have credentials, we cannot proceed.

Expected behavior We are hoping to have customer contacts complete the survey without requiring a Salesforce login.

Environment (please complete the following information):

jrattanpal commented 8 months ago

Please check guide for salesforce sites. You can open up a site for guest user.

Also check main reader page on this GitHub repo. It shows how you need to setup permissions for guest users.

On Tue, Jan 30, 2024 at 6:22 PM DaveWV @.***> wrote:

Describe the bug We're testing Survey Force in our Sandbox environment and have so far successfully created our own simple survey. It seems that we can only take the survey if we have Salesforce credentials. Is this because we're testing in Sandbox or are we distributing the URL incorrectly?

To Reproduce The URL at https://wevideo--frcar--c.sandbox.vf.force.com/apex/takesurvey?id=a4LE20000001czJMAQ&cId=none&caId=none will request a login. If we supply login credentials, we can complete the survey. If we don't have credentials, we cannot proceed.

Expected behavior We are hoping to have customer contacts complete the survey without requiring a Salesforce login.

Environment (please complete the following information):

  • OS: macOS Big Sur
  • Browser: Chrome
  • Version: 120.0.6099.234

— Reply to this email directly, view it on GitHub https://github.com/SalesforceLabs/survey-force/issues/170, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABV6HLHHBHDFYTOEQFMFY5LYRF6CLAVCNFSM6AAAAABCSC5QAKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYDQOJXHE3TAMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

xtjperezx commented 8 months ago

Hi @jrattanpal, I am another user with the same force.com login issue for the guest site we set up. To help troubleshoot, here is a summary of our guest site setup and additional guest user/profile details:

Site Details Site Label: Survey Site Type: Guest User License Active= Yes Active Site Home Page: Take Survey

Site Visualforce Pages Survey Page Survey Force Take Survey Survey Force

Going into the Public Access Setting from Site takes me to the Survey Profile. Inside Survey Profile>User License: Guest User License

Object Settings: Survey Invitations = Read Access Survey Question Responses = Read Access Survey Questions= Read Access Survey Response= Read, Create Survey Takers= Read

Apex Class Access: SFDCAccessControlException SFDCAccessController SFMessage SFQuestion SurveyForceUtil SurveySitesUtil ViewSurveyController ViewSurveyControllerWithoutSharing

Visual Force Page Access: BandwidthExceeded
CommunitiesLogin
CommunitiesTemplate Exception
FileNotFound
ForgotPassword
ForgotPasswordConfirm
InMaintenance
SiteRegister
SiteRegisterConfirm SiteTemplate
SurveyPage
TakeSurvey
TX_SiteLogin
Unauthorized

From Survey Profile the Assigned Users is solely: Site Guest User Survey User License: Guest License Profile: Survey Profile Active= Yes Permission Set Assignment: Survey Force- Guest

From Setup> Sharing Settings Object: Survey Default Internal Access: Public Read/Write Default External Access: Private Grant Acess Using Hierachies= Yes

Other Settings: Minimize the number of roles created, which improves performance by cutting down processing loads= Checked Grant site users access to related cases Checked Secure guest user record access= Checked

Survey Sharing Rule: Survey: Publicly Available= True
Shared With: Suvery Site Guest User Access Level: Read Only

Survey: Created By STARTS WITH005= True Shared With: Survey Site Guest Ueer Access Level: Read Only

What do you think is missing or incorrect from the information provided above?

jrattanpal commented 8 months ago

I cannot say without looking. All I can do is point you to https://help.salesforce.com/s/articleView?id=sf.sites_public_access_settings.htm&type=5

Make sure site is active (it seems it is) and make sure guest user is active and site is publlically available

xtjperezx commented 8 months ago

Hi @jrattanpal thank you for your prompt response. I redid the the entire install in my sand and it looks like i got the guest site to work. Can you tell from the image below, in addition when i attempt to add a question i am presented with this error message: sObject type 'Report' is not supported.

What do you think is the issue? Thank you for your input!

Picture1

jrattanpal commented 8 months ago

I think we maybe using a word "Report" in a class somewhere. And you may have an Apex class with the same name. That may conflict (We have seen that before). That's the only think I can think of

xtjperezx commented 8 months ago

@jrattanpal do you know how to proceed to fix that?

jrattanpal commented 8 months ago

You will have to rename your Apex class I guess. But that may not be easy as you may be using it somewhere.

Having said that, first step is to gather Apex debug logs to confirm where that error is hapening

xtjperezx commented 8 months ago

@jrattanpal through the Apex Debugger, im assuming?

jrattanpal commented 8 months ago

Yes, you can use Developer Console

xtjperezx commented 8 months ago

@jrattanpal thank you! one last question for today: I noticed when I opened the guest site, shown above in the previous post, I had the option to add a question as a guest since I had opened the site in Incognito. That doesn't seem correct, right? I want the guest to read and answer the surveys but not add or create questions to them.

jrattanpal commented 8 months ago

You must have opened it as admin. To test guest functionality, open it in Incognito mode or another browser.

YLedes1114 commented 8 months ago

I think we maybe using a word "Report" in a class somewhere. And you may have an Apex class with the same name. That may conflict (We have seen that before). That's the only think I can think of

Hi there - there is an apex class with the same name from a managed package. How can this be remedied?

jrattanpal commented 8 months ago

I think the "Report" class is called when you use "Create sample survey" or when you use "Report" tab on survey detail page. It shouldn't happen after.

You should be able to create new surveys and then send those to users.