test

Krishna Gandra
Tera Contributor
 
5 REPLIES 5

SanjivMeher
Kilo Patron
Kilo Patron

I dont see gs.getProperty('groupsysid') in your script include.

Is that something you are trying to use in the line 2?

gs.getProperty('groupsysid') should work. In some instance, it doesn't work in scoped app, where i had to query the sys_property table with the property name to get the value.


Please mark this response as correct or helpful if it assisted you with your question.

I used but didnt work. Can you help with this to  ? how it will work ?

It should be something like this.

 

  UserMemberp: function(u_userid, u_grpid) {
        var u_grpid = gs.getProperty('groupsysid');
        var sysuser = JSUtil.nil(u_userid) ? this.getParameter('sysparm_usr').toString() : u_userid;
        var sysgrp = JSUtil.nil(u_grpid) ? this.getParameter('sysparm_grp').toString() : u_grpid;
        var ismember = "false";
        var u_query = "user.sys_id=" + sysuser + "^group=" + sysgrp;
        //var u_query = "user=" + sysuser + "^group=" + sysgrp;
        var gr = new GlideRecord("sys_user_grmember");
        gr.addEncodedQuery(u_query);
        gr.query();
        if (gr.next()) {
            ismember = "true";
        }
        return ismember;
    },

Please mark this response as correct or helpful if it assisted you with your question.

@SanjivMeher I have tried that one earlier.