Need to restrict/hide variable section from RITM

Joyal
Tera Contributor

Hi All,

We have a requirement in order to hide variable section from the RITM for all the users except members from the group 'abc' for the catalog item 'Support'.

 

Step 1: Need to check the cat_item field value is 'Support'
Step 2: check the current user who loads/opens the form is member of the group 'abc'
Step 3: If yes, then he should be able to see the variable section
Step 4: If no, then the variable section and the variable fields inside the variable section should not be visible

Joyal_0-1735313335637.png

 


Please help me on this.

Thanks,
Joyal Robert

6 REPLIES 6

@Joyal 

Your GlideAjax syntax is wrong.

you didn't do as per what I mentioned. Did you not create display BR on sc_req_item table?

It should work fine. please find the update scripts

Display BR:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	g_scratchpad.isMember = gs.getUser().isMemberOf('5f0ee3b78743e910f956c88e8bbb3789'); // give the group name here

})(current, previous);

onLoad

function onLoad() {
    if (g_form.getValue('cat_item') == '81b059c91bbe421083bf86afdc4bcb5f' && g_scratchpad.isMember.toString() == 'true') {
        $j('.veditor_header').hide();
        $j('.veditor_body').hide();
    }
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

@Joyal 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.