- "Install Survey Force"
- Assign "Survey Force - SuperAdmin" permission set to system administrator
- Assign "Survey Force - Admin" to anyone who will administer specific surveys
- Assign "Survey Force - Guest" permission set to Force.com Site guest user (Complete steps on Force.com Site configuration below)
For detailed SFDX installation instructions that do not require installing a package, see the Installation Instructions
- Go to "Survey Force App"
- Open "Getting Started" page
- Click "Make a Sample Survey"
- Click "View Sample Survey"
You should be able to see the survey, add questions, edit CSS, share survey with users and see results. Test this survey by sending it to users. In case of errors, check user permissions to appropriate survey objects. There are 4 Survey objets that you need to check.
Make sure that you check access for Force.com site guest user if you plan to embed this survey in Force.com site.
- Survey
- Survey Question Response
- Survey Taker
- Survey Question
- Create a Force.com Site. Details, including "Creating a Force.com Site"
- You can assign "Survey Force - Guest" permission set to this site's guest user
- You need to activate the Site otherwise guest user will not be activated and you cannot assign permission set
- You will get "Your account has been disabled" error
- Go to the Sites list (https://yourdomain.lightning.force.com/lightning/setup/CustomDomain/home)
- Click on the Site Label
- Click Public Access Settings
- Click View Users
- Click the Site user
- Add the Survey Force - Guest permission set to that user
- If desired, rename the user to something more user-friendly. Do not change other fields.
- OR you can manually assign all the permission to Guest user profile or create a new permission set
- Modify your Site's "Public Access Settings"
- Check "Read" access to "Survey" and "Survey Question" object.
- Check "Read" and "Create" access for "Surveys Taken" and "Survey Question Responses"
- Check "Read" and "Create" access for "Surveys Taken" and "Survey Question Responses"
- Make sure to provide Read/Edit access (as applicable) to all fields in above objects. Otherwise guest users may see "Unauthorized Error" because of field access violation.
- Add the Visualforce page, "Take Survey" to the list of enabled Visualforce pages.
- Add the Apex Classes
- SFDCAccessControlException
- SFDCAccessController
- SFMessage
- SFQuestion
- SurveySitesUtil
- ViewSurveyController
- ViewSurveyControllerWithoutSharing
- Create a Sharing Rule for "Survey" in Setup->Sharing Settings. Allow Read access to "Guest" user where "Publicly Available" (Field:Survey__c.Share_with_Guest_User__c) is true (or any other criteria)
- Without this, Guest user cannot see Survey object becasue of new Guest user restrictions
- See below for details
- Complete "General Surveys" steps.
- Check "Read" access for "Contact" object.
- Check "Read" access for "Case" object.
- Private OWD for Case and Contact?
- Create a public group and add the survey site user.
- Grant read access to case and contact to this group by creating 2 sharing rules
Following notes were posted by "Cynthia Chen" on https://appexchange.salesforce.com/listingDetail?listingId=a0N30000003I2gDEAS&revId=a0S3A00000Jk9SvUAJ&tab=r
-
Error on viewing the report results of the survey: error messages "The report ID and the developer name are not defined. Provide either the report ID or the developer name for the report that contains the chart." and "List has no rows for assignment to SObject"
- It is because the user has no permission to see the report "Survey with Questions and Responses“, share the report folder to the user will solve this error. If want to share this report to all internal users, create a Public Group and add All Internal Users will be OK. (Enable automatic access to records using role hierarchies for public groups by selecting Grant Access Using Hierarchies when creating the group. However, don’t use this option if you’re creating a public group with All Internal Users as members.) (The all internal user group is created only after portals/community are enabled.)
-
If want to put an image in the survey title and let the survey taker see the image,
- Sites > [PublicSiteName] > Public Access Settings > Field-Level Security > look for the survey object > view > give reading permissions to the header: Survey Header (This permission is included in the Guest permission set, so if you use that, this step is not necessary.)
-
"Secure guest user record access": Enabling this will stop Guest user access to Salesforce org data. Enabling this may result in Guest user not having access to Survey Force records. More details are at: https://help.salesforce.com/articleView?id=networks_secure_guest_user_sharing.htm&type=5. Be careful when enabling this feature.
- For this to work, DML code for Guest user has been moved to a without sharing class (ViewSurveyControllerWithoutSharing.cls)
- Create a sharing rule to allow read access to Survey object (and all child objects that includes Survey Questions)
- This sharing rule is based on a new field added to Survey__c object which is true by default. To remove access from Guest user, you can change the default value option OR create a Process Builder process, Flow, or trigger to remove it conditionally based on data
- Do NOT assign Guest user as Owner of Sharing rule (only sharing rule is needed)
- After updating to latest version on the main branch, the ONLY SurveyForce static resources needed are the SurveyForce folder and the UserGuide pdf. All other resources have been removed.
- A new field has been added to allow hiding a specific question on the survey. This allows you to modify and "remove" questions without losing response data.
Unfortunately, Survey Force is un-managed package and cannot be upgraded as per standard package upgrade process. To use this, you need to uninstall existing package and install the latest version. However, you will lose any customizations to code and existing data for included objects.
Because this is an unmanaged package, you have to upgrade your source code directly. This is one way you can upgrade with source code; however, extensive testing is highly recommended.
- Pull source from this GitHub repo from "main" branch
- Push this code to a sandbox
- Keep track of any custom changes you may have made to this application and implement those changes again
- Test all the new changes
- Once testing is complete, push those changes to production and re-test
- In sandbox, you can uninstall older package version (note that this will delete all data if you are using a full sandbox, so do this in a developer sandbox)
- Install latest package from AppExchange
- Keep track of any custom changes you may have made to this application and implement those changes again
- Test all the new changes
- Once testing is complete, push those changes to production or the next sandbox in your promotion chain and re-test
- Delete unnecessary metadata (see below)
There are some metadata items that have been removed from the repository because they were unnecessary. Please manually delete these from your org if upgrading the package. This will be necessary when pushing the metadata from your dev sandbox/scratch org to your full/partial sandbox. If your promotion tools do not include destructive changes, you will need to delete these items in Production as well.
- The ONLY Static Resources now used are SurveyForce (an archive/zip file) and SurveyForce_UserGuide.pdf. Delete the following:
- SurveyForce_SLDS
- SurveyForce_jquery_ui
- SurveyForce_jquery.js
- SurveyForce_svg4everybody.js
- This is because "Create Audit Field" feature has been enabled; https://help.salesforce.com/articleView?id=000328426&type=1&mode=1
- #94
- You can temporairly disable that permission in production OR Remove that test code in https://github.com/SalesforceLabs/survey-force/blob/master/force-app/main/default/classes/SFDCAccessControllerTest.cls (line#141 and 142)