Created
May 16, 2020 18:04
-
-
Save joebordes/a32124e77fdf715b186a643d84d66288 to your computer and use it in GitHub Desktop.
call Business Action from javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getGraph = () => { | |
mermaid.initialize({ startOnLoad: true, securityLevel: 'loose', }); | |
cbconn.doLogin('admin', 'admin', true) | |
.then(()=> { | |
//cbconn.doInvoke('executeBusinessAction', { businessactionid: '47086', 'context':JSON.stringify({'ID':'13x47084', 'MODE':''}) }, 'GET') | |
//cbconn.doInvoke('executeBusinessAction', { businessactionid: '47087', 'context':JSON.stringify({'ID':'13x47084', 'MODE':''}) }, 'GET') | |
cbconn.doInvoke('PushAlongFlow', { pflowid: '47069', 'contextid': '13x47089'}, 'GET') | |
.then(data => { | |
// let graph = data.substr(data.indexOf('graph')); | |
// graph = graph.substr(0, graph.indexOf('</div>')); | |
this.renderGraph(data.graph); | |
var self = this; | |
window[data.functionname] = function (tostate, forrecord, askifsure) { | |
let element = { | |
'id': data.record | |
}; | |
element[data.fieldname] = tostate; | |
cbconn.doRevise(data.module, element).then((data) => self.getGraph()); | |
return false; | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment