RITM variables(variable editor) not being editable

Naga14
Tera Contributor

Hi,

 

We have a client script on the RITM table to make the RITM variables in the variable editor to be editable for the below condition:

when requested for in the RITM is same as the logged in user, stage is work in progress, approval is requested and catalog item is XYZ.

It is working for users with admin role only. We need the variables to be editable for users who has no admin role too. 

Here, the catalog variables are given admin role when created through a client script. Checked by inactivating the client script and removing the admin role for the variables. But didn't work.

Tried ACLs, client scripts, ui policies. 

Can anyone please suggest any solution.

7 REPLIES 7

Can you share your code. I would like to look into it.

Naga14
Tera Contributor

Hi @praveen43 ,

 

There is a client script already existing for other functionality to make variables editable for approvers of the RITM, I have included my script in that one. If I write a new client script for my functionality, it isn't working.

 

//get the variable values

var reqfor = g_form.getValue('u_requested_for');

    var loguser = g_user.userID;

    var apprvl = g_form.getValue('approval');

    var item = g_form.getValue('cat_item');

    var ordgde = g_form.getValue('order_guide');

 

//Make RITM Variables editable

 

        else if ((reqfor == loguser) && (approvalStage == 'waiting_for_approval') && (apprvl == 'requested') && (ordgde == 'c5058253db095814dd62d7795e96193c') && (item == '394a4798dbbf9780dd62d7795e9619bc')) {

            g_form.setVariablesReadOnly(false);

        }

        else if ((reqfor == loguser) && (approvalStage == 'waiting_for_approval') && (apprvl == 'requested') && (ordgde == 'c5058253db095814dd62d7795e96193c') && (item == 'fa3425221b368910ee0743f3cc4bcb12')) {

            g_form.setReadOnly(‘test1’, false);

            g_form.setReadOnly(‘test2’, false);

            g_form.setReadOnly(‘test3’, false);

        }

        else if ((reqfor == loguser) && (approvalStage == 'waiting_for_approval') && (apprvl == 'requested') && (ordgde == 'c5058253db095814dd62d7795e96193c') && (item == '36260fca1b3e5490335aff7dcc4bcb1a')) {

            g_form.setReadOnly('test4', false);

            g_form.setReadOnly('test5', false);

 

        }

               else if ((reqfor == loguser) && (approvalStage == 'waiting_for_approval') && (apprvl == 'requested') && (ordgde == 'c5058253db095814dd62d7795e96193c') && (item == 'e0ae0718db33d780dd62d7795e961946')) {

            g_form.setReadOnly('test6', false);

            g_form.setReadOnly('test7', false);

        }

else {
            g_form.setVariablesReadOnly(true);
        }

HI,

else if ((reqfor == loguser) && (approvalStage == 'waiting_for_approval') && (apprvl == 'requested') && (ordgde == 'c5058253db095814dd62d7795e96193c') && (item == '394a4798dbbf9780dd62d7795e9619bc')) {

            g_form.setVariablesReadOnly(false);

        }

 

 

here replace 'else if' with "if"