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

Question

Question

Modern Designer run lookup only on specific step process

asked on March 1, 2023

Hey guys,

 

Just wondering if it is possible to have a lookup run only on a certain process stage?

 

I have a form that is broken up into process stages and it seems like if a user overwrites a lookup value, the next task will overwrite that value with the lookup.

 

I've tried setting that field to "disable" if the process stage has changed, but it still appears to be overwriting.

0 0

Replies

replied on March 2, 2023

Hi Jay,

If you set the lookup target field as hidden and ignore data, then the lookup result would not be overwritten:

0 0
replied on March 2, 2023

Hi Rui,

Thanks for your response.

Unfortunately, in my scenario - I need these particular fields to still display for every Process Step.

Is there any JavaScript functionality I can employ with the LFForm object, to check which Process Step is currently active?

0 0
replied on March 3, 2023 Show version history

Unfortunately, I don't believe this is currently possible with the new designer and the LFForm object.

As the new designer runs your custom scripts within a sandboxed iFrame, it doesn't have direct access to the form/window/document and can only work through the LFForm object.  According to the help files (https://doc.laserfiche.com/laserfiche.documentation/11/administration/en-us/Default.htm#../Subsystems/Forms/Content/Javascript-and-CSS/JavaScript-in-the-Forms-Designer.htm#changeFieldSettings) it does not appear that the LFForm object has the interfaces we need to get the name of the current step.

There doesn't appear to be a getFormSettings interface, and regardless, the changeFormSettings interface only lists the label and description as the accessible components, so it is unlikely a get command would have access to anything other than those two values.

In the Classic designer, I would handle this by including a Custom HTML field, whose contents were "{/_current_step_name}".  That would automatically update it each time the form is loaded to list the name of the step.  Then I would use Javascript to get the text from that element (accessed by class name or q-id).  I tried to do that in the new designer with the LFForm object.  The Custom HTML field works and does display the name of the step.  But accessing it via the LFForm object doesn't appear to be possible.  Although the changeFieldSettings interface says it can access the content (HTMLContent) of custom HTML fields, there doesn't appear to be an equivalant interface for getFieldSettings to lookup what is already in place on the field.  Something like that would be necessary to see the text from that Custom HTML fields.

Hopefully Laserfiche will add these kinds of functionalities in future updates.

0 0
replied on March 7, 2023

If you still want the field to be displayed but don't want it to be changed, what about duplicate the value with formula and display another field instead?

As for using custom script to check current step, similiar as Matthew said, this could be done on modern form: add a field with default value being {/_current_step_name}, and use field rule to always hide it and ignore data; thus the value would always be the current step on each user task and you can use getFieldValues to get the current step name.

1 0
replied on March 2, 2023

Hi Rui,

Thanks for your response.

Unfortunately, in my scenario - I need these particular fields to still display for every Process Step.

Is there any JavaScript functionality I can employ with the LFForm object, to check which Process Step is currently active?

You are not allowed to follow up in this post.

Sign in to reply to this post.