UI action

Anusha Medharam
Tera Contributor

I have created one UI action when login user click that UI action remove his name from assigned to  and state changes to new but when click UI action it asking please select records. Without selecting can we remove login user name from assigned field and state changes to new.

 

gr = new GlideRecord('sn_customerservice_case');
gr.addQuery('assigned_to', gs.getUserID());
gr.addQuery("state","10");
gr.query();
var count =0;
while (gr.next()) {
    gr.assigned_to = '';
    gr.state = '1';
    count = count+1;
    gr.update();
}
if(count>0){
    gs.addInfoMessage(count+" Cases has been moved to New State and assigned to name removed too")
}else{
    gs.addInfoMessage("There are no Open Cases assigned to :"+gs.getUserDisplayName());
}
1 ACCEPTED SOLUTION

@Anusha Medharam i just checked it in my PDI .It OOB behaviour for list banner type UI action .

You have to select records and then proceed with the script .Otherwise it wont run the code.

 

Hope this helps 

Mark the answer correct if this helped you

Thanks

View solution in original post

17 REPLIES 17

@Anusha Medharam Where is the alert "No records selected" coming from ? Did you mention it any where in the script or is it coming unknowingly ?

No, IUi Action.PNG did not keep in the script and any where.

@Anusha Medharam i just checked it in my PDI .It OOB behaviour for list banner type UI action .

You have to select records and then proceed with the script .Otherwise it wont run the code.

 

Hope this helps 

Mark the answer correct if this helped you

Thanks

please put OOB UI action name

Abhijeet_Pawar
Tera Guru

Hello @Anusha Medharam ,

can you please specify where you build that UI action button I means on list or form.