Make Risk Assesment via BR update Change record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 01:52 PM
Hello, someone please help/suggestions.
Client wants to use the BR risk calculation, however after filling out the risk assessment and submitting, it doesn't automatically run the risk calculation. We have to make a change on the change request and save to see the risk calculation run. They want it to run after you hit submit on the risk assessment questionnaire as this is confusing to users. Or at the very least, right click and save and it run (it doesn't unless you change someone on the record).
I've been looking at the BR and I don't understand why it's not updating the Change Request and changing the Risk field.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 02:29 PM
The issue is that the risk assessment is stored in a separate table so you need to create a business rule on the Task Assessment (task_assessment) table that will then run the risk calculation on submit.
The condition of your business rule should be completed by is not empty or !gs.nil(current.completed_by)
The following script should invoke the assessment:
var taskRec = current.getRefRecord();
var risk = new RiskAssessmentCalculator().calculateRisk(taskRec);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 04:07 PM
Not sure if I'm doing this wrong... I did create a new br on the task_assessment table to calculate. It calculates and shows the info msg briefly at the top of the Task Assessment page. It doesn't update the Change record. I added a taskRec.update(); to the end of the script. However the Change doesn't indicate it's been updated. Also we have a change script that forces work notes if you manually change the risk field, which is triggered this way... but not with the OOTB business rule.
I've also been using Re: How could you get the risk assessment to calculate automatically? as a guide... I am failing miserably.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2017 04:46 PM
Wow I got it working using a suggestion in that link. I don't use BR but UI Action (copy the Execute Risk Calculation) and put in the action name, etc as suggested with this comment by benn23
Re: How could you get the risk assessment to calculate automatically?
I modified all of it some to get it to get all of my requirements but.. finally!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2017 09:56 AM
I tested retested in my personal dev before I moved to the client's environment. Tested a couple there, went to bed. Today it works half the time (about). It looks like the Risk Assessment is saving before the Change updates/runs calculation. I tried adding time to the Timeout with no results. 😕 I can't track down why it works sometimes and not others.