У меня есть метод ссылки на страницу в контроллере Apex.
Мне нужно закрыть текущую вкладку.
Вот мой код:
public PageReference savePostSurveyAnswer(){
String sitePathPrefix = Site.getPathPrefix();
System.debug('savePostSurveyAnswer method start');
CaseIdentifierIdValue = ApexPages.currentPage().getParameters().get('caseIdentifierId');
ShGl_PostChatSurvey__c postChatSurvey = new ShGl_PostChatSurvey__c();
postChatSurvey.ShGl_SurveyQuestion1__c = question1;
postChatSurvey.ShGl_SurveyQuestion2__c = question2;
postChatSurvey.ShGl_SurveyQuestion3__c = question3;
postChatSurvey.ShGl_SurveyQuestion4__c = question4;
postChatSurvey.ShGl_SurveyResponse1__c = questionAnsSelected1;
postChatSurvey.ShGl_SurveyResponse2__c = questionAnsSelected2;
postChatSurvey.ShGl_SurveyResponse3__c = questionAnsSelected3;
postChatSurvey.ShGl_SurveyResponse4__c = questionAnsSelected4;
postChatSurvey.ShGl_Market_Code__c = 'US'; //new data base model
postChatSurvey.ShGl_UniqueCaseIdentifier__c = CaseIdentifierIdValue;
//postChatSurvey.ShGl_LiveTranscriptChatKey__c = chatKeyIdValue;
//postChatSurvey.ShGl_CaseOfSurvey__c = (Id) LiveChatTranscriptObj.CaseId; //through trigger
Database.SaveResult postSaveResult = Database.insert(postChatSurvey);
return new PageReference('javascript:window.close();');
}
Заранее спасибо.
Любая помощь будет оценена.