darrenhillconsulting
02/09/2022, 8:30 PMdarrenhillconsulting
02/09/2022, 8:31 PMbattk
02/09/2022, 8:37 PMbattk
02/09/2022, 8:37 PMdarrenhillconsulting
02/09/2022, 8:41 PMEric B
02/09/2022, 8:41 PMdarrenhillconsulting
02/09/2022, 8:41 PMdarrenhillconsulting
02/09/2022, 8:42 PMdarrenhillconsulting
02/09/2022, 8:45 PMbattk
02/09/2022, 8:46 PMdarrenhillconsulting
02/09/2022, 8:46 PMEric B
02/09/2022, 8:50 PMhere's the code I used a while back...
if (curStep != undefined) {
switch(Number(curStep)) {
case 1:
/* need to grab this value using DOM because it isn't available via the context object*/
var id = document.getElementById('hddn_custpage_customer_fs').value;
var name = document.getElementById('custpage_customer_display').value;
var po = document.getElementById('custpage_purchasename').value;
var paramPO = getParameterByName('po');
var sessionObj = runtime.getCurrentSession();
sessionObj.set({name: 'purchase_name', value: po});
sessionObj.set({name: 'customer_id', value: id});
var sessionScope = runtime.getCurrentSession().get({
name: 'scope'
});
var po = sessionObj.get({name: 'purchase_name'});
var cust = sessionObj.get({name: 'customer_id'});
console.log('@saveRecord session objects', po, cust, sessionScope);
console.log('paramPO', paramPO);
//if the user came via the Assistant link
if (id != '' && po != '') {
if (isAdded != 'added') {
var added = submitStep1(id, po, paramPO);
console.log('added', added);
return added;
}
else {
return true;
}
}
break;
case 2:
//client side validation here before it passes it to the POST on the SL
//step 2 is triggered off of submitStep2 which redirects the the assistant SL
/*
var url = document.getElementById('entryformquerystring').value;
var urlDomain = gsUtilities.getCurrentDomain();
console.log('urlDomain ' + urlDomain + url);
//location.href = url;*/
return true;
break;
case 3:
//client side validation here before it passes it to the POST on the SL
//var url = gsUtilities.getScriptURL('customscript_gs_sl_edi_process_assistant','customdeploy_gs_sl_edi_process_assistant');
//console.log(url);
return true;
break;
case 4:
//client side validation here before it passes it to the POST on the SL
var url = gsUtilities.getScriptURL('customscript_gs_sl_edi_process_assistant','customdeploy_gs_sl_edi_process_assistant');
console.log(url);
break;
case 5:
//client side validation here before it passes it to the POST on the SL
var url = gsUtilities.getScriptURL('customscript_gs_sl_edi_process_assistant','customdeploy_gs_sl_edi_process_assistant');
console.log(url);
break;
default:
return true;
}
}
else {
showMessage('Process incomplete!', 'error');
return false;
}Eric B
02/09/2022, 8:51 PMdarrenhillconsulting
02/09/2022, 8:59 PMbattk
02/09/2022, 9:02 PM