How can I force a single RITM update when one or more variables are updated?

Shane J
Tera Guru

I have a Catalog Item that 3/4 parts of an equation will be filled out at time of submission, and the last 1/4 completed after submission.

When that last 1/4 is filled in, a calculation needs to run to fill in another variable (let's call it Score).

Due to how the fulfilling group will be working these, it's not really feasible to handle this in the workflow.  They need the freedom to have this calculation rerun whenever needed.

That being the case, what I thought I could do was:

1-Setup a before BR on the Variables table that on update would run a script to update the related RITM (just update some field to cause the RITM to be updated)

2-Have a BR on the RITM that would perform the calculation for the appropriate variables and update the Score variable

The issue is, I don't want the BR for #1 to update the RITM for every variable updated, if multiple are changed at the same time.  Is there a way to prevent that?  Getting this mechanism setup to do a single update to the RITM from variables could prove useful into the future.

 

I'm also open to alternate suggestions for how to handle this.  I know a UI Action would likely work but that would be manual (and a one-off solution). 😉

1 ACCEPTED SOLUTION

Hello,

I believe it goes work, when the variables are updated. If you change a variable, the RITM is still updated when a variable is updated from within.

find_real_file.png

Updating a variable:find_real_file.png

Either way, you have a few methods, but the point is, you can run a BR on update of a particular RITM if those fields contain a value. The script will run to calculate and go from there.

Otherwise, as I mentioned wayyyyy back in my original post when first replying to your question...you can use onChange client scripts.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

11 REPLIES 11

Allen Andreas
Administrator
Administrator

Hi,

Can you give more information around this statement you said: "They need the freedom to have this calculation rerun whenever needed".

So...what "changed" to have them need this reran against what is there now? Wouldn't some value or something on the record need to be changed anyway for this? I'm not understanding how someone would open a record, nothing has changed, and so they need the freedom to rerun it again?

If something did change, and it's something they're doing on the form, then it sounds like you need to incorporate an onChange client script that when 'x' field is changed...the overall "score" field gets calculated. This way they see it in the moment. If they like what they get, they can keep it and save, otherwise, it gets dumped.

Perhaps more information can be given around the "occurrence" as to when this 1/4 part of the "score" would be updated so we can assist further.

One thing I will mention is that for your approach with setting up a BR on the variables table to run an update against a RITM, just to have the script ran...sounds a bit clunky. There seem to be more information around this "score" field than what you've told us so far. Let us know?

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Sorry Allen, I guess I didn't explain it well enough.  The assumption here is that fulfillers will have write access to the Variable Editor.

On the Portal, 3 variables will be valued by the customer.  Let's use:

  • Severity
  • Probability
  • Occurrence

Those will provide 3 of 4 parts of the calculation for the Score (variable).

After submission, the fulfiller will update an additional variable:

  • Scale

At that time, the 4 of those variables need to be multiplied together to fill in the Score.

 

I want to make sure that whenever one of those 4 variables is updated, the Score variable reflects that.  They could update these variables at any given point while the RITM is active.

I don't see how that would be feasible to do within the Workflow.  But if the Variable being updated in turn updated the RITM, I could run whatever BR I want off the RITM - which I think would be easier to maintain.

I'm trying to avoid adding one-off fields to RITM or Catalog Task to do these updates on the backend.

 

You can also create four different onchange catalog client scripts (One for each variable) and calculate the score whenever any one of them changes.

I guess I hadn't considered that.  All of the Catalog Client Scripts come along for the ride in the Variable Editor?