- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 06:17 PM
Hi All ,
In The Change Form in Schedule Planned start date and End Date should Editable for particular XYZ Group for entire change cycle they can able edit .
Notes -
I Think i need to write OnChange Cilent Script
- I need to Get Current Logged in user
- I Need to check whether that user belongs to XYZ Group
- If user = XYZ Group , then user can able to edit schedule planned start and date .
- If user != XYZ Group , then it should read only .
* We have to do this for this particular XYZ Group .
* For some groups they have made readonly by using UIPolicy ,
* I have tried UIPolicy It doesn't work ,
* We need to write Cilent script
Please help me
@Saurav11 @kamlesh kjmar @Radhika Aluru
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 08:08 PM
Hello,
Please do the below:-
Create a display BR on change request table with below code:-
(function executeRule(current, previous /*null when async*/) {
g_scratchpad.group='false';
if(gs.getUser().isMemberOf('Database'))
{
g_scratchpad.group='true';
}
})(current, previous);
Then in the existing UI policy you have just delete the UI policy action from it:-
And then in the UI policy itself in the execute if true section use the below code:-
function onCondition() {
var group = g_scratchpad.group;
alert(group);
if (group == 'true') {
g_form.setReadOnly('start_date',false);
g_form.setReadOnly('end_date',false);
} else {
g_form.setReadOnly('start_date',true);
g_form.setReadOnly('end_date',true);
}
}
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2022 04:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 06:58 AM
Great tutorial, thank you. If it's for adding a role, remember to add it in the access control.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 10:18 PM
hello,
Create a display BR on change request table
try this code is executed on my PDI
g_scratchpad.group='false'; if(gs.getUser().isMemberOf('Database')) { g_scratchpad.group='true'; }
Then Write UI policy
function onCondition() { var group = g_scratchpad.group; alert(group); if (group == 'true') { g_form.setReadOnly('start_date',false); g_form.setReadOnly('end_date',false); } else { g_form.setReadOnly('start_date',true); g_form.setReadOnly('end_date',true); } }
Thanks.
Please mark my answer as correct based on Impact.