Ad Code

Responsive Advertisement

How to use Surveyforce for Custom Object(Any Object)


Title: How to use Surveyforce for Custom Object(Any Object)




Requirement(Use Case): How to send a Survey Link to customer/consumer once the order is delivered to the Customer. So one manufacturing company( THE INDIA AMUL TEA) would like to capture the feedback from the customer corresponding to the recent order which is being completed by the Manufacturing company with help of some short of Questionnaire. THE INDIA AMUL TEA company is already using salesforce to capture the Primary Order as well as Secondary Order from the Customer. So THE INDIA AMUL TEA company would like to use some native application to gather feedback from Customer.

Solution: In this Solution, let's Assume THE INDIA AMUL TEA is using Order using Custom Object Name Called Order__c.

and Order__c object following fields are there
  • Order amount----Currency Field
  • Order Primary Person Email Id---Email Field
  • Order Number--Auto Number field
  • Order Stage--Picklist(Draft, Accepted, Shipped, Delivered)
Step 1. Install surveyforce app in your Org. https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000003I2gDEAS

Post Install Guide - Public Facing Surveys

  1. General Surveys

    1. Create a Force.com Site. Details, including "Creating a Force.com Site"
    2. Modify your Site's "Public Access Settings"
    3. Check "Read" access to "Survey" and "Survey Question" object.
    4. Check "Read" and "Create" access for "Surveys Taken" and "Survey Question Responses"
    5. Add the Visualforce page, "Take Survey" to the list of enabled Visualforce pages.

    Survey Connecting to Contact or Case Records

    1. Complete "General Surveys" steps.
    2. Check "Read" access for "Contact" object.
    3. Check "Read" access for "Case" object.
    4. Private OWD? Check this thread.
Note: This guide will help you how to use Surveyforce "Surveyforce User Guide"
https://appexchange.salesforce.com/servlet/servlet.FileDownload?file=00P3A00000VpvvJUAR



Step 2: Now create a relationship with Case object and Order Object. Create a Lookup field on Case object of Order Object.
and also Create Formula Field on Case







Note: In SurveyForce app Contact and Case object is default field to capture the survey input on contact or Case or both Object but not for the Custom object.


Step 3:  Now we need to show Order Number on survey form so that consumer can see for which order number he is submitting the survey. after Adding a field on Case Object now we need to do some changes in the Apex Class component and VF Page. This Apex class is the Part of Survey force App.


Apex class Name: ViewSurveyController 

This is the Apex Class change see line no. 17 add this line and line no 99 to 102
public string PrimaryOrderNo {get;set;}

List<Case> lstcases=[Select id, Order_Number__c from Case where id=:caseId];
            if(lstcases.size()>0){
            PrimaryOrderNo= lstcases[0].Order_Number__c;  
            }

1:  /* Controller associated with pages rendering the survey.  
2:   * Used by SurveyPage, ResultsPage, TakeSurvey  
3:   */  
4:  global virtual without sharing class ViewSurveyController {  
5:    public String qQuestion           {get; set;}  
6:   public Boolean qRequired           {get; set;}  
7:   public String qChoices            {get; set;}  
8:    public String surveyName            {get; set;}  
9:    public String surveyHeader        {get; set;}  
10:    public String surveyId             {get;   
11:      set{  
12:        this.surveyId = value;  
13:        init();  
14:      }  
15:    }    
16:    public String renderSurveyPreview      {get; set;}  
17:    public string PrimaryOrderNo                              {get;set;}  
18:    public String questionName          {get; set;}   
19:    public String questionType          {get; set;}  
20:    public Boolean questionRequired       {get; set;}  
21:   public List<SelectOption> singleOptions  {get; set;}   
22:    public List<SFQuestion> allQuestions    {get; set;}  
23:    public List<String> responses          {get; set;}  
24:    public Integer allQuestionsSize        {get; set;}  
25:    public String templateURL        {get; set;}  
26:    public String surveyThankYouText     {get; set;}  
27:    public String surveyContainerCss {get; set;}  
28:    public String surveyThankYouURL     {get; set;}  
29:   public String caseId           {get; set;}  
30:   public String contactId {get;set;}  
31:    public String anonymousAnswer {get;set;}  
32:    public List<SelectOption> anonymousOrUser {get;set;}  
33:    public Boolean isInternal {get;set;}  
34:    public String baseURL {get;set;}  
35:    public String userId{get;set;}  
36:    public String userName{get;set;}  
37:    public String surveyTakerId {get;set;}  
38:    public Boolean thankYouRendered{get;set;}  
39:    public List<String> newOrder {get;set;}  
40:    /* Retrieves the list of questions, the survey name, after retrieving the   
41:      necessary parameters from the url.  
42:    */  
43:   //------------------------------------------------------------------------------//   
44:    public ViewSurveyController(ApexPages.StandardController stdController) {  
45:      // Get url parameters  
46:      surveyId = Apexpages.currentPage().getParameters().get('id');  
47:      caseId  = Apexpages.currentPage().getParameters().get('caId');  
48:      contactId = Apexpages.currentPage().getParameters().get('cId');   
49:      if(caseId ==null || caseId.length()<15){  
50:        caseId = 'none';  
51:      }  
52:      if(contactId ==null || contactId.length()<15){  
53:        contactId = 'none';  
54:      }        
55:      // By default the preview is not showing up  
56:      renderSurveyPreview = 'false';  
57:      init();  
58:    }   
59:    public ViewSurveyController(viewShareSurveyComponentController controller)  
60:    {  
61:      surveyId = Apexpages.currentPage().getParameters().get('id');  
62:      caseId  = Apexpages.currentPage().getParameters().get('caId');  
63:      contactId = Apexpages.currentPage().getParameters().get('cId');   
64:      if(caseId ==null || caseId.length()<15){  
65:        caseId = 'none';  
66:      }  
67:      if(contactId ==null || contactId.length()<15){  
68:        contactId = 'none';  
69:      }      
70:      // By default the preview is not showing up  
71:      renderSurveyPreview = 'false';  
72:      init();  
73:    }  
74:    public void init()  
75:    {  
76:      if (surveyId != null){   
77:        // Retrieve all necessary information to be displayed on the page  
78:        allQuestions = new List<SFQuestion>();  
79:        setupQuestionList();  
80:        setSurveyNameAndThankYou(surveyId);  
81:        anonymousOrUser = new List<SelectOption>();  
82:        anonymousOrUser.add(new SelectOption('Anonymous',System.Label.LABS_SF_Anonymous));  
83:        anonymousOrUser.add(new SelectOption('User','User ' + UserInfo.getFirstName() + ' ' + UserInfo.getLastName()));  
84:        anonymousAnswer = 'Anonymous';  
85:        isInternal =true;  
86:        newOrder = new List<String>();  
87:        String urlBase = URL.getSalesforceBaseUrl().toExternalForm();  
88:        baseURL = urlBase;  
89:        userId = UserInfo.getUserId();  
90:        userName = UserInfo.getName();  
91:        List<Case> lstcases=[Select id, Order_Number__c from Case where id=:caseId];  
92:        if(lstcases.size()>0){  
93:             PrimaryOrderNo= lstcases[0].Order_Number__c;   
94:        }  
95:        String profileId = UserInfo.getProfileId();  
96:        try  
97:        {  
98:          Profile p = [select Id, UserType from Profile where Id=:profileId];  
99:          if (p.UserType == 'Guest')  
100:          {  
101:            isInternal = false;  
102:          }  
103:          else  
104:          {  
105:            isInternal = true;  
106:          }  
107:        }  
108:        catch (Exception e){  
109:          isInternal = false;  
110:        }  
111:        thankYouRendered=false;  
112:      }      
113:    }  
114:  //----------------------------------------------------------------------------//    
115:    /* Called during the setup of the page.   
116:      Retrieve questions and responses from DB and inserts them in 2 lists. */  
117:    public Integer setupQuestionList(){  
118:      getAQuestion();  
119:      return allQuestions.size();  
120:    }  
121:    /** Sets the survey's name variable  
122:    * param: sID  The survey ID as specified in the DB  
123:    */  
124:    public void setSurveyNameAndThankYou(String sId){  
125:      Survey__c s = [SELECT Name, Id, URL__c, Thank_You_Text__c, thankYouText__c, thankYouLink__c, Survey_Header__c, Survey_Container_CSS__c FROM Survey__c WHERE Id =:sId];  
126:      surveyName = s.Name;  
127:      surveyHeader = s.Survey_Header__c;  
128:      templateURL = s.URL__c+'id='+sId;//+'&cId={!Contact.Id}'+'&caId='+'{!Case.id}';  
129:      surveyThankYouText = s.Thank_You_Text__c;  
130:      if (surveyThankYouText == null)  
131:      {  
132:        surveyThankYouText = System.Label.LABS_SF_Survey_Submitted_Thank_you;  
133:      }  
134:      surveyThankYouURL = s.thankYouLink__c;  
135:      surveyContainerCss = s.Survey_Container_CSS__c;  
136:    }  
137:  //------------------------------------------------------------------------------//    
138:   public Pagereference updateSurveyName(){  
139:     Survey__c s = [SELECT Name, Id, URL__c, thankYouText__c, thankYouLink__c FROM Survey__c WHERE Id =:surveyId];  
140:     s.Name = surveyName;  
141:     try{  
142:      update s;  
143:     }catch (Exception e){  
144:      Apexpages.addMessages(e);  
145:     }  
146:     return null;  
147:   }   
148:  //------------------------------------------------------------------------------//     
149:    public Pagereference updateSurveyThankYouAndLink(){  
150:      Survey__c s = [SELECT Name, Id, URL__c, thankYouText__c, thankYouLink__c FROM Survey__c WHERE Id =:surveyId];  
151:      s.thankYouText__c = surveyThankYouText;  
152:      s.thankYouLink__c = surveyThankYouURL;  
153:      try{  
154:        update s;  
155:      }catch(Exception e){  
156:        Apexpages.addMessages(e);  
157:      }  
158:      return null;  
159:    }  
160:   //------------------------------------------------------------------------------//    
161:   /** When requested from the page - when the user clicks on 'Update Order' -  
162:     this function will reorganize the list so that it is displayed in the new order  
163:    */  
164:    public Pagereference refreshQuestionList(){  
165:    setupQuestionList();  
166:    return null;  
167:    }  
168:  //------------------------------------------------------------------------------//     
169:  //------------------------------------------------------------------------------//    
170:   private static boolean checkRequired(String response, Survey_Question__c question){  
171:    if(question.Required__c == true){  
172:      if(response == null || response =='NO RESPONSE')  
173:       return false;  
174:    }  
175:    return true;  
176:   }   
177:    /** Redirects the page that displays the detailed results of the survey,   
178:      from all users who took the survey.  
179:    */  
180:    public PageReference resultPage() {  
181:      return new PageReference('/apex/ResultsPage?id='+surveyId);  
182:    }  
183:  //------------------------------------------------------------------------------//   
184:  //------------------------------------------------------------------------------//   
185:    /**   
186:    */  
187:    public List<String> getResponses() {  
188:      List<SurveyQuestionResponse__c> qr = [Select Survey_Question__c, SurveyTaker__c, Response__c, Name From SurveyQuestionResponse__c limit 100];  
189:      List<String> resp = new List<String>();  
190:      for (SurveyQuestionResponse__c r : qr) {  
191:        resp.add(r.Response__c);  
192:      }  
193:      return resp;  
194:    }   
195:   /** Fills up the List of questions to be displayed on the Visualforce page  
196:    */    
197:    public List<SFQuestion> getAQuestion() {  
198:        qQuestion = '';  
199:        qChoices ='';  
200:      List<Survey_Question__c> allQuestionsObject =   
201:                      [Select s.Type__c, s.Id, s.Survey__c, s.Required__c, s.Question__c,   
202:                      s.OrderNumber__c, s.Name, s.Choices__c   
203:                      From Survey_Question__c s   
204:                      WHERE s.Survey__c =: surveyId ORDER BY s.OrderNumber__c];  
205:      System.debug(allQuestionsObject);  
206:      allQuestions = new List<SFQuestion>();  
207:      Double old_OrderNumber = 0;  
208:      Double new_OrderNumber;  
209:      Double difference = 0;  
210:      /* Make sure that the order number follow each other (after deleting a question, orders might not do so) */  
211:      for (Survey_Question__c q : allQuestionsObject){   
212:        new_OrderNumber = q.OrderNumber__c;  
213:        difference = new_OrderNumber - old_OrderNumber - 1;  
214:        if (difference > 0) {  
215:          Double dd = double.valueOf(difference);  
216:          Integer newOrderInt = dd.intValue();  
217:          q.OrderNumber__c -= Integer.valueOf(newOrderInt);   
218:        }  
219:        old_OrderNumber = q.OrderNumber__c;  
220:        SFQuestion theQ = new SFQuestion(q);  
221:        allQuestions.add(theQ);  
222:      }  
223:      allQuestionsSize = allQuestions.size();  
224:      return allQuestions;  
225:    }    
226:    public void submitResults()  
227:    {  
228:      try {  
229:        List <SurveyQuestionResponse__c> sqrList = new List<SurveyQuestionResponse__c>();  
230:        System.debug('Here 1');  
231:        for (SFQuestion q : allQuestions) {  
232:          System.debug('Here 2');  
233:          SurveyQuestionResponse__c sqr = new SurveyQuestionResponse__c();  
234:          if (q.renderSelectRadio == 'true') {  
235:            if (q.required && (q.selectedOption == null || q.selectedOption == '')) {  
236:              Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please fill out all required fields'));  
237:              return;  
238:            }  
239:            if (q.selectedOption == null || q.selectedOption == '') {  
240:              sqr.Response__c = '';  
241:            } else {  
242:              sqr.Response__c = q.singleOptions.get(Integer.valueOf(q.selectedOption)).getLabel();  
243:            }  
244:            sqr.Survey_Question__c = q.Id;  
245:            sqrList.add(sqr);  
246:          } else if (q.renderFreeText == 'true') {  
247:            if (q.required && q.choices == '') {  
248:              Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please fill out all required fields'));  
249:              return;  
250:            }  
251:            System.debug('*****Select Radio ' + q.choices);  
252:            sqr.Response__c = q.choices;  
253:            sqr.Survey_Question__c = q.Id;  
254:            sqrList.add(sqr);  
255:          } else if (q.renderSelectCheckboxes == 'true') {  
256:            if (q.required && (q.selectedOptions == null || q.selectedOptions.size() == 0)) {  
257:              Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please fill out all required fields'));  
258:              return;  
259:            }  
260:            for (String opt : q.selectedOptions) {  
261:              sqr = new SurveyQuestionResponse__c();  
262:              if (opt == '' || opt == null) {  
263:                sqr.Response__c = '';  
264:              } else {  
265:                sqr.Response__c = q.multiOptions.get(Integer.valueOf(opt)).getLabel();  
266:              }  
267:              sqr.Survey_Question__c = q.Id;  
268:              sqrList.add(sqr);  
269:            }  
270:          } else if (q.renderSelectRow == 'true') {  
271:            if (q.required && (q.selectedOption == null || q.selectedOption == '')) {  
272:              Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please fill out all required fields'));  
273:              return;  
274:            }  
275:            if (q.selectedOption == null || q.selectedOption == '') {  
276:              sqr.Response__c = '';  
277:            } else {  
278:              sqr.Response__c = q.rowOptions.get(Integer.valueOf(q.selectedOption)).getLabel();  
279:            }  
280:            sqr.Survey_Question__c = q.Id;  
281:            sqrList.add(sqr);  
282:          }  
283:        }  
284:        if(AddSurveyTaker())  
285:        {  
286:          System.debug('Here 3');  
287:          for (SurveyQuestionResponse__c sqr : sqrList)  
288:          {  
289:            sqr.SurveyTaker__c = surveyTakerId;  
290:          }  
291:          System.debug('Here 4');  
292:          insert sqrList;  
293:          thankYouRendered=true;  
294:        }  
295:      }catch(Exception e){  
296:        if(isInternal) {  
297:          Apexpages.addMessages(e);  
298:        }else{  
299:          System.debug('Exception: ' + e.getMessage());  
300:          Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, 'Some error occured while saving response'));  
301:        }  
302:      }  
303:    }  
304:    private Boolean AddSurveyTaker()  
305:    {  
306:      String userId;  
307:      if (surveyId == null)  
308:      {  
309:        return false;  
310:      }  
311:      if(caseId.toUpperCase() =='NONE'|| caseId.length()<5)  
312:       caseId = null;    
313:      if(contactId.toUpperCase() =='NONE'|| contactId.length()<5)  
314:       contactId = null;       
315:      if (anonymousAnswer != 'Anonymous')  
316:      {  
317:        userId = UserInfo.getUserId();  
318:      }  
319:      else  
320:      {  
321:        userId = null;  
322:      }  
323:      if(anonymousAnswer != 'Anonymous' && (contactId != null || caseId != null))  
324:      {  
325:        List<SurveyTaker__c> check = [Select Contact__c, Survey__c, Case__c, User__c From SurveyTaker__c Where Contact__c=:contactId and Survey__c=:surveyId and Case__c = :caseId and User__c=:UserId];  
326:        if(check != null && check.size()>0){  
327:          Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, System.Label.LABS_SF_You_have_already_taken_this_survey));  
328:          return false;      
329:        }  
330:      }  
331:      SurveyTaker__c st = new SurveyTaker__c();  
332:      st.Contact__c = contactId;  
333:      st.Survey__c = surveyId;  
334:      st.Taken__c = 'false';  
335:      st.Case__c = caseId;  
336:      st.User__c = userId;  
337:      insert st;   
338:      surveyTakerId = st.Id;  
339:      return true;    
340:    }  
341:  }  

In VF Page : 
TakeSurvey

Add following changes to display Order Number
see line no 27 and add the same in VF Page.

<div class="slds-text-heading--medium">Order No: {!PrimaryOrderNo}</div>



1:  <apex:page standardcontroller="Survey__c" extensions="ViewSurveyController" cache="false" sidebar="false" showheader="false">  
2:    <apex:includeScript value="{! $Resource.SurveyForce_jquery}"/>  
3:    <!-- convertCheckBoxToLDS() is in surveyforce.js -->  
4:    <apex:includeScript value="{! $Resource.SurveyForce + '/surveyforce.js'}"/>  
5:    <apex:stylesheet value="{! $Resource.SurveyForce + '/surveyforce.css'}"/>  
6:    <apex:stylesheet value="{! $Resource.SurveyForce + '/surveyforce_pagemessage_override.css'}"/>  
7:    <apex:stylesheet value="{! $Resource.SurveyForce_SLDS + '/assets/styles/salesforce-lightning-design-system-vf.min.css'}"/>  
8:    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />  
9:    <script>  
10:      $(document).ready(function(){  
11:        //Convert any elements with "convertToLDS" style to SLDS styles  
12:        //Used in certain places where it's not easy to use SLDS for those elements like "apex:selectCheckboxes"  
13:        convertCheckBoxToLDS();  
14:      });  
15:    </script>  
16:    <!-- Custom CSS added by survey admin -->  
17:    <style>  
18:      <apex:outputText value="{!HTMLENCODE(surveyContainerCss)}" escape="false"/>  
19:    </style>  
20:    <div id="survey_container" class="surveyforce">  
21:      <apex:form id="theForm"  >  
22:        <apex:outputPanel id="seeSurvey" rendered="{! If((Survey__c.Hide_Survey_Name__c == false || Survey__c.Survey_Header__c != ''), True, False )}" >  
23:          <div class="slds-box slds-theme--shade">  
24:            <div class="slds-text-heading--large"><apex:outputText value="{!Survey__c.Survey_Header__c}" escape="false" /> </div>  
25:            <apex:outputPanel rendered="{!Survey__c.Hide_Survey_Name__c == false}">  
26:              <div class="slds-text-heading--medium">{!Survey__c.Name}</div>  
27:              <div class="slds-text-heading--medium">Order No: {!PrimaryOrderNo}</div>  
28:            </apex:outputPanel>  
29:          </div>  
30:        </apex:outputPanel>  
31:        <script>  
32:          $(document).ready(function(){  
33:            overridePageMessages();  
34:          });  
35:        </script>  
36:        <apex:pageMessages />  
37:        <c:uiMessage severity="success" message="{!surveyThankYouText}" renderMe="{!thankYouRendered == true}" />  
38:        <apex:outputPanel rendered="{!thankYouRendered == false}">  
39:          <div class="slds-form--stacked">  
40:            <apex:repeat value="{!allQuestions}" var="qPreview" id="aQPreview">  
41:              <div class="slds-box slds-theme--default">  
42:                <div class="slds-form-element">  
43:                  <label class="slds-form-element__label">  
44:                      {!qPreview.orderNumber + ': ' + qPreview.question}  
45:                      <apex:outputText rendered="{! qPreview.required}" value="({!$Label.LABS_SF_Required})" />  
46:                  </label>  
47:                </div>  
48:                <apex:outputPanel rendered="{!qPreview.renderSelectRadio}">  
49:                  <apex:selectRadio styleClass="convertToLDS" layout="pageDirection" rendered="{!qPreview.renderSelectRadio}" value="{!qPreview.selectedOption}" >  
50:                    <apex:selectOptions value="{!qPreview.singleOptions}"/>  
51:                  </apex:selectRadio>  
52:                </apex:outputPanel>  
53:                <apex:outputPanel rendered="{!qPreview.renderSelectCheckboxes}">  
54:                  <apex:selectCheckboxes styleClass="convertToLDS" layout="pageDirection" rendered="{!qPreview.renderSelectCheckboxes}" value="{!qPreview.selectedOptions}" >  
55:                    <apex:selectOptions value="{!qPreview.multiOptions}"/>  
56:                  </apex:selectCheckboxes>  
57:                </apex:outputPanel>  
58:                <apex:outputPanel rendered="{!qPreview.renderFreeText}">  
59:                  <div class="slds-form-element">  
60:                    <div class="slds-form-element__control" >  
61:                      <apex:inputTextArea styleClass="slds-textarea" cols="" rows="{!qPreview.noOfRowsForTextArea}" rendered="{!qPreview.renderFreeText}" value="{!qPreview.choices}"/>  
62:                    </div>  
63:                  </div>  
64:                </apex:outputPanel>  
65:                <apex:outputPanel rendered="{!qPreview.renderSelectRow}">  
66:                  <apex:selectRadio styleClass="convertToLDS" rendered="{!qPreview.renderSelectRow}" value="{!qPreview.selectedOption}">  
67:                    <apex:selectOptions value="{!qPreview.rowOptions}"/>  
68:                  </apex:selectRadio>  
69:                </apex:outputPanel>  
70:              </div>  
71:            </apex:repeat>  
72:          </div>  
73:        </apex:outputPanel>  
74:        <apex:outputPanel rendered="{!thankYouRendered == false}">  
75:          <div class="slds-box slds-theme--default">  
76:            <apex:outputPanel rendered="{!isInternal}" >  
77:                <span class="slds-text-body--regular">{!$Label.LABS_SF_Answer_as}:</span>  
78:                <apex:selectRadio styleClass="convertToLDS" value="{!anonymousAnswer}">  
79:                  <apex:selectOptions value="{!anonymousOrUser}" />  
80:                  <apex:actionSupport event="onchange" rerender="hiddenAnonymousAnswer"/>  
81:                </apex:selectRadio>  
82:                <apex:inputHidden value="{!anonymousAnswer}" id="hiddenAnonymousAnswer"/>  
83:                <br />  
84:            </apex:outputPanel>  
85:            <apex:commandButton styleClass="slds-button slds-button--brand" action="{!submitResults}" value="{!$Label.LABS_SF_SubmitSurvey}" rerender="theForm,seeSurvey" />  
86:          </div>  
87:        </apex:outputPanel>  
88:      </apex:form>  
89:    </div>  
90:  </apex:page>  
Step 4:  We have to write a Process Builder to generate Case/Create Case once order stage is Changed to Delivered. we will also populate the Order Lookup field on Case while creating Case Record.

See Salesforce for more detail


Step 5: Now we have to generate the Survey Link and create email template as well as create Workflow rule send the Survey link to Contact Person. This email alert we have to write on Case Object.


  • Open the surveyforce app
  • Choose Surveys Tab
  • Select required Surveys that you have created.

  • Choose an appropriate site and copy the link to Further use in email template. 
Create Email Template on Case and update Email body with that Survey Link. See Below.


Write a workflow rule email alert.


END.

Survey Form will look like this





Hiccups and Solution:
1. Header and Image was not displaying while opening Survey Link
Solution: Open guest profile user and add all Field level security Read only for Survey Taken and Survey Object.

For further query please email us at amulhai@gmail.com



Reactions

Post a Comment

6 Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Hello, the test class for ViewSurveyController = 74%, can you please share an update where it's increased coverage, thanks

    ReplyDelete
    Replies
    1. Sorry for Late Reply. Please use following test class ViewSurveyController_Test

      Delete
  3. It was unimaginable for me to get so high grades in my dreamt certification unless I unfolded When I downloaded free demo inquiries ofsalesforce exam dumps I saw how these dumps are going to support me. Microsoft PDF questions and answers helped me get ready well and show remarkable outcomes.

    ReplyDelete