Skip to content

Instantly share code, notes, and snippets.

@RockyMtnMarc
Created August 17, 2019 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RockyMtnMarc/1558a95d496816e2d18ed85090848010 to your computer and use it in GitHub Desktop.
Save RockyMtnMarc/1558a95d496816e2d18ed85090848010 to your computer and use it in GitHub Desktop.
Apex Class which retrieves the Survey_URL__c field from the LiveChatTranscript with the specified ChatKey
public class SurveyRedirectController {
public PageReference redirectToSurvey() {
String url = [SELECT Id, Survey_URL__c, ChatKey FROM LiveChatTranscript WHERE ChatKey = : ApexPages.currentPage().getParameters().get('chatKey')].Survey_URL__c;
PageReference surveyURL = new PageReference(url);
return surveyURL;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment