You are viewing limited content. For full access, please sign in.

Question

Question

Modern Designer Formulas not Updating after new data is Populated from Workflow.

asked on August 31, 2023

Hello,

 

I have seen a post for this issue using the Classic Designer, but I am hoping to understand a workaround for Modern Designer.

https://answers.laserfiche.com/questions/200279/Retrigger-a-formula#200284

 

I have a Form Page that summarizes trip data, and performs a workflow to enter the Earliest Trip Date, and a Form calculation to gather the Earliest Trip Date, and assign a Fiscal Year to it.

 

Since the Page can be revisited after adding a trip, the calculation is stale, and not updating unless you click on the date the calculation is using.

Would anyone have an idea on how I can force the calculation each time this page loads?

 

Currently using Modern Designer and have tried to use the following JavaScript:

changeFieldSettings(idObject, changes)

setFieldValues(id,value)

 

Thanks

1 0

Answer

SELECTED ANSWER
replied on September 5, 2023

Hi Michael, 

The modern form designer it quite different from classic designer and it does not have direct access to the document, form, fields, attributes, etc.  But you can edit the forms and fields via the LFForm Interface , you can find more information here

But to solve your problem, you can use a similar logic with the post you shared. You can force the calculation to update the fields when page loads by triggering a change in that field. In the following code it set the field to empty then back to its original value to trigger a "change"

I haven't test the code on specific form, but this might be a fix that you want to follow :)

var temp = LFForm.getFieldValues({fieldId: yourFieldID});

LFForm.setFieldValues({fieldId: yourFieldID}, "");

LFForm.setFieldValues({fieldId: yourFieldID}, temp );

 

 

2 0
replied on September 6, 2023

Hi Yuxuan,

 

This is exactly what I needed!

 

Storing the value in a variable and re-applying the date is allowing for the formula (Other field) to look at the new date and calculate properly.

 

I appreciate your help!

2 0
replied on September 6, 2023

No problem, glad to hear it helps :)

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.