- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 08:08 AM
Hello,
I have a requirement to recalculate the Assessment Data Results on Demands.
Current Assessment Data looks like this:
On the Assessment Instance, the user can update the values:
I am looking to create UI Action on the demand page to recalculate the assessment data.. any ideas?
THank you
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 10:15 AM
Ok, so now try to determine whether the business rule is running or not - do you still have the logging line, and are you seeing anything in the logs?
I edited 4 values so this gets logged when the business rule runs

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 10:29 AM
Hi, If you are seeing the message but the scores don't change I imagine that the business rule portion isn't working correctly. You can determine this by looking at the Assessment Results related list - the business rule should re-run the logic that calculates the results, so they should change if you edit the instance question values.
Example:
For example, if all the Risk question values (on the instance) are 9's:
then the results should look something like this:
and the score looks like this:
If you change the question values (on the instance) to all 5's:
then the results should also change (if the business rule is working):
So if the UI action runs, it updates the score:
The UI action uses the results, so if they don't change then the scores won't. Can you take a screenshot of your business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 10:55 AM
hi, thank you SO much for all this info:
Yes, the message is being displayed. I am hoping i am just missing something small.
here is my business rule:
(I have insert and update selected, I've tried with just Update checked and it doesn't work)
Here is the code- I have changed it because we have a custom business rule
Notice the script is different because during the setup of our Demand module, the business rule to populate the score was disabled and this one was created - So in my new business rule, I used that code.
(function executeRule(current, previous /*null when async*/) {
var assessmentUtil = new RSMAssessmentUtil();
assessmentUtil.populateScores(current);
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 11:33 AM
Sorry - I mean to say the UI Action code is different because we have a custom business rule:
function rerun(){
gsftSubmit(null, g_form.getFormElement(), 'rerun_metrics');
}
if (typeof window == 'undefined')
callScriptInclude();
function callScriptInclude() {
var assessmentUtil = new RSMAssessmentUtil();
assessmentUtil.populateScores(current);
gs.addInfoMessage('Demand Scores Recalculated');
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 12:07 PM
Hi, everything seems fine, although you only want the business rule to run on update (i.e. only when someone changes their question values).
Try adding some logging like this:
You should see a log entry for each question value updated, so you'll know if the rule actually ran. Also, when you update a question value now, is the related result value being updated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2023 08:11 AM
Hello! Thanks again. So I added the script to the business rule and I can't see anything in the logs.. so I did debugging and I do see this message:
Action script not found, rerun_metrics. That is the name of the business rule.
Any ideas with this?
Also, none of the values are being updated (not in the Assessment Results or Assessment Data).
THank you again for all of your help