Name

global.CSWizardHelper

Description

Helper functions for Customer Service Wizard

Script

var CSWizardHelper = Class.create();
CSWizardHelper.prototype = Object.extendsObject(AbstractAjaxProcessor, {
  getWizardAccount: function(){
  	if(current.variables.contact && !current.variables.account){
  		var contact = new GlideRecord("customer_contact");
  		contact.addQuery("sys_id", current.variables.contact);
  		contact.query();
  		if(contact.next()){
  			return "sys_id="+contact.getValue('account');
  		}
  	}
  	return;
  },
  getWizardAccountName: function(){
  	if(current.variables.account)
  		return current.variables.account;
  },
  getWizardContactAsset: function(){	
  	if(current.variables.account)
  		return 'account='+current.variables.account;
  	return;
  },
  getWizardProduct: function(){
  	if(current.variables.account)
  		return 'company='+current.variables.account;
  	return;
  },
  storeWizSessionVariable: function(name,value){
  	try{
  		var session_var_name   = this.getParameter('sysparm_session_var');
  		var session_var_value   = this.getParameter('sysparm_session_val');
  		gs.getSession().putClientData(session_var_name, session_var_value);
  		if(gs.getSession().getClientData(session_var_name)==session_var_value)
  			return "success";
  		else
  			return "failed";
  	}
  	catch(e){
  		
  	}
  },
  type: 'CSWizardHelper'
});

Sys ID

6760b464c313020095ccd02422d3aec0

Offical Documentation

Official Docs: