UI Action with List menu Context
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 04:26 AM - edited 07-20-2023 02:06 PM
Hi,
I'm creating a UI Action (List menu Context), to record the comments, then I have to do a GlideRecod to change the status and record the comment in the problem table, but when I run the Action it gives this error:
Unable to find UI Action with name 'rprovaprb' on table 'problem'
I'll send the screenshot:
function ree_repproval(){
if (confirm('teste ?')){
var reprovacao = prompt("teste ?");
g_form.setReadOnly('u_teste ', false);
g_form.setVisible('u_teste ', true);
g_form.setValue('u_teste ', reprovacao);
g_form.setValue('description', ' Justificativa técncia reprovação 2: ' + reprovacao + '\n\n' + g_form.getValue('description'));
if (g_form.getValue('u_teste ') == '') {
g_form.setReadOnly('u_teste ', false);
g_form.setVisible('u_teste ', true);
g_form.setMandatory('u_teste ', true);
g_form.addErrorMessage('Preencha explicação Técnica da reprovação do pedido.');
return false;
}
gsftSubmit(null, g_form.getFormElement(), 'rprovaprb');
}
}
Can you help me? I need so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 04:47 AM
Hi @122932
Please share the code instead of screenshot.
sample code for Using client and server code in a UI action.
// Client-side onclick function
function onClick() {
//client side code
// Call the UI action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'action name'); //MUST call the 'Action name' set in this UI Action
}
// Code that runs without 'onclick'
// Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
methodName();
// Server-side function
function methodName() {
//server side logic
}
Using client and server code in a UI action
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 05:41 AM
Hi,
Sorry, follow the code:
function ree_repproval(){
if (confirm('teste ?')){
var reprovacao = prompt("teste ?");
g_form.setReadOnly('u_teste ', false);
g_form.setVisible('u_teste ', true);
g_form.setValue('u_teste ', reprovacao);
g_form.setValue('description', ' Justificativa técncia reprovação 2: ' + reprovacao + '\n\n' + g_form.getValue('description'));
if (g_form.getValue('u_teste ') == '') {
g_form.setReadOnly('u_teste ', false);
g_form.setVisible('u_teste ', true);
g_form.setMandatory('u_teste ', true);
g_form.addErrorMessage('Preencha explicação Técnica da reprovação do pedido.');
return false;
}
gsftSubmit(null, g_form.getFormElement(), 'rprovaprb');
}
}