One custom task for all WI
I need to create a custom task that allows to print WI data (SR/IR/CR/PR).
How can I make one script block for all WI?
Example for IR:
<p>$(document).ready(function () {<br>app.custom.formTasks.add(<i><b>'Incident'</b></i>, localization.Print, function (formObj, viewModel) {</p><p><b>...</b></p><p>});</p>
Best Answer
-
Geoff_Ross Cireson Consultant O.G.Hi Vladimir,
You cannot as it needs adding to each form respectively. But you can do this to avoid having the bulk of code multiple times.app.custom.formTasks.add('Incident', localization.Print, function (formObj, viewModel) { printWI() }) app.custom.formTasks.add('ServiceRequest', localization.Print, function (formObj, viewModel) { printWI() }) app.custom.formTasks.add('Problem', localization.Print, function (formObj, viewModel) { printWI() }) function printWI() { //Print function here }
Geoff5
Answers
You cannot as it needs adding to each form respectively. But you can do this to avoid having the bulk of code multiple times.
Geoff
Hi Geoff,
But the Cireson own tasks are working on ALL WI (e.g. print or sendEmail)
I did it!
I have created own version of "Cireson Task" (not "Custom Task").
"Own task" is necessary to register in the file "taskBuilder.js" and add to the list of tasks in the file "wiMain.js"