deleting post

lakshmi_laksh
Tera Contributor
 
7 REPLIES 7

J Siva
Tera Sage

Hi @lakshmi_laksh 
1. Client check box should be checked on your UI action.

2. Use client callable script include to update the group member records.

Sample:
UI Action:

JSiva_0-1746776943930.png

 

JSiva_1-1746776986110.png

function executeAction() {
    var selectedRecord = g_list.getChecked();
    if (selectedRecord != '') {
        var script = new GlideAjax('CatalogUtlis');
        script.addParam('sysparm_name', 'setPrimaryGroup');
        script.addParam('sysparm_ids', selectedRecord);
		script.getXMLAnswer(response);
    }
}
function response(answer){
	alert("Done");
}

 Script include:

JSiva_2-1746777070904.png

   setPrimaryGroup: function() {
        var selectedRecord = this.getParameter('sysparm_ids');
        var rec = new GlideRecord('sys_user_grmember');
        rec.addEncodedQuery('sys_idIN' + selectedRecord);
        rec.query();
        while (rec.next()) {
            rec.u_primary_group = true;
            rec.update();
        }
    },

Regards,
Siva

.

 

@lakshmi_laksh  Could you share your configuration pic/scripts? Also may I know what error you are getting?

.