Skip Navigation
Expand
Parameters accepted by the the buildSurveyURL method and expected usage
Answer ID 11897   |   Last Review Date 06/21/2021

What parameters can the buildSurveyURL method accept and what is the expected usage?

Environment:

Customer Portal, Surveys
Oracle B2C Service, All versions

Resolution:

The buildSurveyURL method from the standard Survey model is used to build a URL for accessing the survey specified in the $surveyID variable; this method can accept five values, as follows:

  1. $surveyID
  2. $contactID
  3. $incidentID
  4. $chatID
  5. $opID

As the variable names suggest, the surveys.survey_id, contacts.c_id, incidents.i_id, chats.chat_id and opportunities.op_id values are expected.

One important mention to be made is that the $incidentID, $chatID and $opID variables mutually exclude each other, in this specific order.

Example:

buildSurveyUrl($surveyID = 2, $contactID = 500, $incidentID = 10200, $chatID = 200, $opID = 30);

In this case a URL will be generated for survey_id 2 and the survey results will be associated with the contact ID 500 and incident ID 10200. The $chatID and $opID values will not be used, meaning that the survey can only be associated to the incident or chat or opportunity, passing NULL values for the unneeded parameters.

If you would like to associate the survey with an opportunity, the buildSurveyUrl method call would be:

buildSurveyUrl($surveyID = 2, $contactID = 500, $incidentID = NULL, $chatID = NULL, $opID = 30);