- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 07:06 AM
Hello,
I have updated our Assessments to that the asmt_assessment_instance_question value can be updated.
I am looking to store the original value that was present when the assessment was submitted.
I thought I had it working yesterday, then we cloned down our instance and my business rule was lost. Now I redid it and it's not working. here is the business rule I am trying to use..
Here is the code:
(function executeRule(current, previous /*null when async*/) {
current.original_value = previous.value;
})(current, previous);
What am I missing?
there is a column titled "original_value", and the field the user is able to update is "value"...
Any ideas?
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 07:55 AM
Hi,
It appears that your business rule runs "After" and there is no "current.update();" (which is to be avoided in an After BR). Set your BR to run "Before".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 10:17 AM
Thanks.. I think the issue is that when the record on the asmt_assessment_instance_question is inserted, the "Value" is null.
So if the rule runs as I have it setup above, the "original_value" will be null.
I want the oringinal_value to be populated once the assessment instance is submitted and the value field is populated with an actual value.
I have tried multiple different ways to do this (in the condition of the BR, I have said where assessment instance state changes to Complete, etc), and nothing seems to work.
Thanks again for all of your help!