- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 09:08 AM
I have a requirement to make the actual end date field on mandatory when change is in the implement state. This will normally be a UI action which I have done but the problem is when I select the implement button, changes move to the implement state and the actual end date becomes mandatory as expected but does not stay in implement state when refreshed.
See UI Policy
Cannot seem to get this to work as intended, so I marked the UI Policy and inactive and modified the UI Action for implement and added a line of code current.setMandatory("work_end",true);
This seem to do the trick, but business is saying they want mandatory field to show as mandatory prior to trying to move to Review state.
Currently does not show as mandatory unless the attempt to move to the review state, that's when it lets them know they field is a mandatory field.
How can I make this field mandatory as soon as the implement button is selected, and it stays on the implement state even if I refresh the page?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:46 AM - edited ‎11-24-2023 12:21 PM
This is an easy scenario to replicate with the information you have provided, and test. What's happening is the UI Action first changes the State to 'Implement'. With a UI Policy or Data Policy in place, this field immediately becomes mandatory, so the form cannot be submitted or saved without populating the Actual end date, therefore the update is aborted, so the record is still in the Authorize state when the form is refreshed. For this reason, the UI Policy needs to be inactivated, or better yet deleted. Put the 'Implement' UI Action back to out of box, and create a simple Client Script on the change_request table:
function onLoad() {
if (g_form.getValue('state') == -1 || g_form.getValue('state') == 0 || g_form.getValue('state') == 3) { //Implement, Review, Closed
g_form.setMandatory('work_end', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:41 AM
as soon as I completed the authorized stated, went to the schedule state for a second and immediately landed on the implement state.
It should go from authorized to scheduled, only after I select the implement state should it move to the implement state and stay in that state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:46 AM
@Lydon ,
There is OOTB flow which moves the state from scheduled to implement once the planned start date is met.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 10:46 AM - edited ‎11-24-2023 12:21 PM
This is an easy scenario to replicate with the information you have provided, and test. What's happening is the UI Action first changes the State to 'Implement'. With a UI Policy or Data Policy in place, this field immediately becomes mandatory, so the form cannot be submitted or saved without populating the Actual end date, therefore the update is aborted, so the record is still in the Authorize state when the form is refreshed. For this reason, the UI Policy needs to be inactivated, or better yet deleted. Put the 'Implement' UI Action back to out of box, and create a simple Client Script on the change_request table:
function onLoad() {
if (g_form.getValue('state') == -1 || g_form.getValue('state') == 0 || g_form.getValue('state') == 3) { //Implement, Review, Closed
g_form.setMandatory('work_end', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 11:21 AM
You guys are amazing, Brad's solution worked.
Thank you all for the help as I have been struggling with this one