How can I add a Cancel button on Service Portal ?

gmorales
Kilo Expert

Hello Guys,

I got a requirement to add a cancel button to cancel the actual order and redirec to home page... However I thought they were using CMS, I've noticed that there is a Plug in called "Service Portal" and it builds a complete site... this is completely new for me I've started to play with this but is completely different I've tried this (https://serviceportal.io/create-custom-action-buttons-service-portal/) but there is no instructions on how to add it to a specific page or form. Need Help ASAP, I couldn't find a documentation or clear examples of this.

Thanks!

1 ACCEPTED SOLUTION

Go here;



find_real_file.png



Then go here;



find_real_file.png



Click the "Edit Ticket Form (ticket) page in Designer



Then Drag&Drop your new widget into the page where you want it!


View solution in original post

14 REPLIES 14

The buttons just are not showing up in the test Requests and Incidents I've created. I do not receive an error message. We're in Kingston so thats what I need it to work in.  I'm fairly new to SN so whatever steps you can provide is appreciated.  BTW....your packaged update set & doc were helpful.

 

renne1
Tera Contributor

Hi,

 

Incident Widget is working for me in Kingston. But for requested Item i get the following error message in log:

org.mozilla.javascript.EvaluatorException: GlideRecord.get() - invalid table name: null (<refname>; line 32)
Line(32)
return table;
evaluateString(JavaScript evaluation error on:
(function(){(function() {
data.sys_id = input.sys_id || options.record_id || $sp.getParameter("sys_id");
data.table = input.table || options.record_table || $sp.getParameter("table");
data.table = _getActualTable(data.table, data.sys_id);
data.maxAttachmentSize = parseInt(gs.getProperty("com.glide.attachment.max_size", 1024));
if (isNaN(data.maxAttachmentSize))
data.maxAttachmentSize = 24;
data.largeAttachmentMsg = gs.getMessage("Attached files must be smaller than {0} - please try again", "" + data.maxAttachmentSize + "MB");
data.attachmentSuccessMsg = gs.getMessage("Attachment successfully uploaded");

if (!data.table || !data.sys_id)
return;

var gr = new GlideRecord(data.table);
if (!gr.isValid())
return;

if (!gr.get(data.sys_id))
return;

if (input && input.action == "deleted") {
gr.comments = input.action + " an attachment";
gr.update();
}

data.canWrite = gr.canWrite();
data.canAttach = gs.hasRole(gs.getProperty("glide.attachment.role")) && GlideTableDescriptor.get(data.table).getED().getAttribute("no_attachment") != "true";
data.canRead = gr.canRead();

function _getActualTable(table, id) {
var rec = new GlideRecord(table);
if (rec.get(id) && rec.getValue('sys_class_name')) {
return rec.getValue('sys_class_name');
}
return table;
}
})();
})()
)

renne1
Tera Contributor

in London it works 🙂 

 

Thank You!

Hey thank you for this awesome widget! I just have one hiccup with this. After the user hits cancel, the worknotes in the tree has a popup that just sais undefined. 

 

find_real_file.png

Hi all

I have a similar requirement but the cancel incident button is not working. I am working Quebec.

Please guide

Thanks and regards