If Resource Plan is completed capacity in workbench is not updating
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2025 02:59 AM
If Resource Plan is completed then capacity is Resource workbench is still showing same, it should be updated.
Example : If Resource Plan is completed for July month, Capacity is 30 hrs and allocated hours are 10 hrs then Availability is 20 hrs but as resource plan is already completed then Allocated hours should become 0 in this case and Availability should be 30 hrs.
How to achieve this, please assist.
Thanks,
Chahak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2025 03:28 AM
Hi @Chahak kindra
You can once try like this.
Business Rule (Recommended for Real-time Updates)
Create a business rule on the resource_plan table.
Trigger it after update when the state of the Resource Plan changes to Completed.
Set the Allocated Hours to and update the Availability to match the Capacity.
(function executeRule(current, previous /*null when async*/) {
if (current.state == 'completed') { // Ensure Resource Plan is completed
var resourceWorkbench = new GlideRecord('resource_workbench'); // Adjust table name if needed
resourceWorkbench.addQuery('resource_plan', current.sys_id);
resourceWorkbench.query();
while (resourceWorkbench.next()) {
resourceWorkbench.allocated_hours = 0;
resourceWorkbench.availability = resourceWorkbench.capacity; // Reset availability
resourceWorkbench.update();
}
}
})(current, previous);
Scheduled Job (For Periodic Updates)
If real-time updates are not required, create a scheduled job to run daily or weekly.
It will check for completed Resource Plans and update the Allocated Hours accordingly.
Ensure Data Integrity
Verify that the Resource Workbench table correctly reflects the Capacity and Availability fields.
If necessary, update the Resource Allocation Workbench logic to reflect these changes.
Stay awesome,
Roshnee Dash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2025 12:39 PM
Hi @Chahak kindra
If you found my response helpful, please mark it as correct and close the thread so others can benefit from it too.
Stay awesome,
Roshnee Dash