Skip to content

Instantly share code, notes, and snippets.

@jsmithdev
Created April 10, 2017 13:45
Show Gist options
  • Save jsmithdev/1d8d51ad4fd8b3d0e9365d5bdb6239bb to your computer and use it in GitHub Desktop.
Save jsmithdev/1d8d51ad4fd8b3d0e9365d5bdb6239bb to your computer and use it in GitHub Desktop.
$('body').on('click', 'button#sitpr', function() {
let sessionId = $.urlParam('SessionId');
let serverUrl = $.urlParam('ServerUrl');
let siId15 = '{!si.Id}'.substring(0,15);
let masterId15 = '{!congaMasterTemp}'.substring(0,15);
let techId15 = '{!congaTechPrint}'.substring(0,15);
let costId15 = '{!congaCostId}'.substring(0,15);
let detailActive = '{!siDetail.Active__c}'.substring(0,15);
let congParams = ''+
'&id='+siId15+' '+
'&ReportId=[SvcInqTech]'+techId15+'?pv0='+siId15+'~?pv1='+
'&ReportId=[SICOST]'+costId15+'?pv0='+siId15+'~?pv1='+
'&ReportId=[SvcInq]'+masterId15+'?pv0='+siId15;
congParams = encodeURI(congParams);
congParams = congParams.replace(/%5B/gi, '[').replace(/%5D/gi, "]");
congParams = '?sessionId='+sessionId+'&serverUrl='+serverUrl+congParams;
window.open('//composer.congamerge.com/composer8/index.html'+congParams, 'Conga', 'width:800px')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment