UI Action Button 'Reject' Requires (Mandatory) Additional comments field to be filled

Blitz
Tera Expert

 UI Action Button 'Reject' changes the State to 'Reject' but Additional comments field should be mandatory/required then  after comment is posted clicking the 'Reject' Button must be redirected to list view of custom table

What script for that?

 

snipp.pngstate value for Reject is 13

Custom Table Name: 

x_762234_campuscon_connect_requests 

1 ACCEPTED SOLUTION

Gopi Naik1
Kilo Sage

Hi @Blitz ,

 

Use below script.

 

function information(){

g_form.setValue('state','13');

if (g_form.getValue('comments') == '') {

g_form.setMandatory('comments', true);

g_form.showFieldMsg('comments','Reason is required when rejecting a Change','error');

return false;

}

gsftSubmit(null, g_form.getFormElement(), 'reject_approval'); //MUST call the 'Action name' set in this UI Action

}

if (typeof window == 'undefined')

serverReject();

function serverReject(){

current.state = 'rejected';

current.update();

}

 

 

 

If my solutions helps you to resolve the issue, Please accept solution and Hit "Helpful".

Thanks,
Gopi

View solution in original post

1 REPLY 1

Gopi Naik1
Kilo Sage

Hi @Blitz ,

 

Use below script.

 

function information(){

g_form.setValue('state','13');

if (g_form.getValue('comments') == '') {

g_form.setMandatory('comments', true);

g_form.showFieldMsg('comments','Reason is required when rejecting a Change','error');

return false;

}

gsftSubmit(null, g_form.getFormElement(), 'reject_approval'); //MUST call the 'Action name' set in this UI Action

}

if (typeof window == 'undefined')

serverReject();

function serverReject(){

current.state = 'rejected';

current.update();

}

 

 

 

If my solutions helps you to resolve the issue, Please accept solution and Hit "Helpful".

Thanks,
Gopi