- 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-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-01-2022 08:19 PM
Hello,
If my answer helped you can you also mark it as correct.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 07:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 10:00 PM
In the execute if false keep it empty that should be fine.
Please mark my answer as correct based on Impact.