Server side Ui action is Not working in Native UI

Saurabh Dubey1
Tera Expert

Hi Experts,

I would like to ask a question since, I also want to display the UI action on portal, here is mine code 

 

 

serverResolve();

function serverResolve() {
    current.status = 'approve';
    gs.eventQueue('x_1078056_holiday.x_1078056_holiday_appr', current, current.name_employee, '');
    current.update();
	action.setRedirectURL(current);
}

 

 

 as soon as I click on the UI action button the button is not working and not responding 

Please help how can I resolve this issue 

 

This is happening in Custom scoped application

1 ACCEPTED SOLUTION

Saurabh Dubey1
Tera Expert

The issue is resolved there was onsubmit client script running that was restricting the operation

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Saurabh Dubey1 

did you try commenting action.setRedirectURL()?

you said it's not working in native UI so is it working in portal?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes I tried commenting that, no it is not working anywhere It is in custom scoped application

 

But if I change it to this code it is working in native UI. 

 function approveButton() {
    g_form.setValue('status', 'approve');
 gsftSubmit(null, g_form.getFormElement(), 'my_approve'); // 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')
serverResolve();

function serverResolve() {
    current.status = 'approve';
    gs.eventQueue('x_1078056_holiday.x_1078056_holiday_appr', current, current.name_employee, '');
    current.update();
    //action.setRedirectURL(current);
}
 
For this client callable should be checked but it won't display on portal 😞

Please help me

Saurabh Dubey1
Tera Expert

The issue is resolved there was onsubmit client script running that was restricting the operation