Make Risk Assesment via BR update Change record

Cheri M
Kilo Sage

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!

11 REPLIES 11

Cheri, the task_assessment record gets created as soon as the assessment is displayed.   Its basically a blank record that will be used to store the values.   If the user ends up closing the assessment popup or cancels out of it, that blank record is deleted.   That is why I had suggested the business rule concept since you know its been filled out when the completed by value is set.


Thank you.   I had tried the BR as you suggested but it was not working correctly.   What is frustrating is this is just calling the Execute Risk Calculation ui action.   It should work and it DOES work but only half the time.


Realized I had a typo in my code above, but the configuration below works for me:


find_real_file.png



find_real_file.png



Here is the script:


(function executeRule(current, previous /*null when async*/) {


   


      var taskRec = current.task.getRefRecord();


      var risk = new RiskAssessmentCalculator().calculateRisk(taskRec);


      taskRec.update();


   


})(current, previous);


Michael, thank you for trying to help   It is much appreciated.   This still does not work for me.   The Risk field does not change on the Change Request.   I had previously fixed the typo (added task to the variable for taskRec)


I think I might have had it working before I went down the other path but the other issue with this is the info msg doesn't appear at the top of the change request, which is needed.   BTW I am on Jakarta Patch 1


My instance is Jakarta Patch 3, though this feature has been in the platform for many releases. Not sure what to say. I have used this trick a few times and it has always worked for me.