Name

sn_customerservice.CaseImpl

Description

All functionalities for the Case APIs consolidated in this implementation class

Script

var CaseImpl = Class.create();
CaseImpl.prototype = {
  initialize: function() {
  	this.caseDao = new CaseDao();
  	this.logger = global.CSMBaseLogger.getLogger("CaseImpl");
  },

  createCaseFromAPI : function(params){
  	if(params){
  		return this.caseDao.createCase(params);
  	} else{
  		this.logger.error("submit params invalid!");
  	}
  },

  updateCaseFromAPI: function(id, params, getCaseDetails, displayValue, selectedFields){
  	if(params){
  		return this.caseDao.updateCase(id, params, getCaseDetails, displayValue, selectedFields);
  	} else{
  		this.logger.error("submit params invalid!");
  	}
  },

  getCaseInfo : function(id, displayValue){
  	return this.caseDao.getCaseById(id, displayValue);
  },
  
  getCaseInfoBySearchString : function(searchQueryStr, offset, limit, displayValue, referenceFields, selectedFields){
  	return this.caseDao.getCaseBySearchQueryString(searchQueryStr, offset, limit, displayValue, referenceFields, selectedFields);
  },
  
  getReferenceListAndChoices : function(column, start, end, query, dependent_value, ref_qual_input, id, reference_field_columns){
  	return this.caseDao.getReferenceListAndChoices(column, start, end, query, dependent_value, ref_qual_input, id, reference_field_columns);
  },
  
  getCaseActivityStream : function(id, start, end, activityType){
  	return this.caseDao.getCaseActivityStream(id, start, end, activityType);
  },

  showEmailsActivity : function(){
  	if (gs.hasRole("admin"))
  		return true;
  	var allowedRoles = gs.getProperty("glide.ui.activity.email_roles", "");
  	return gs.hasRole(allowedRoles);
  },

  type: 'CaseImpl'
};

Sys ID

691ec1215352030097a2ddeeff7b1287

Offical Documentation

Official Docs: