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

Question

Question

{/_current_step_id} not changing when moving through our business process.

asked on May 11, 2022

Hey everyone,

 

I am working on a business process in Laserfiche Forms for contract management. I am attempting to use one form throughout the entire process, which is requiring some CSS and JavaScript to work. Essentially, there are fields and table rows that I am trying to hide when in a particular process step, and required when in another process step. The plan was to have a hidden field that either keeps track of the current user or current step ID. Then, I would have an if statement in JavaScript that does something like this:

if ($('#q58').val(20)){
    $('#q56').hide();
  } else {
    $('#q56').attr('required', 'true');
  }

This code would continue for all the fields and table rows that I want hidden in a process step, and required in another process step. Unfortunately, when I submit the form and it moves to the next process step, it is holding onto the previous process step instead of the current one. I've tried the same thing with current user and tested with my coworker, but it is giving the same result. Is there a way to have that field dynamically change when the form moves from one process step to another? Any answers are appreciated!

 

Thanks!

0 0

Replies

replied on May 11, 2022

One a variable value is given a value it will hold that value until it is removed. That is why the system variable of {/_current_step_id} keeps the same value. You would want to have some JavaScript that replaces the value in your hidden field and replaces it with the new current step id value each time.

1 0
replied on May 11, 2022

Do you know what the syntax would be to replace the current step ID process variable when a form moves to the next step? I'm a little new to JavaScript so I assumed this function would work, but it doesn't...

$('.Submit').click(function () {
   	$('#q58').val().replace({/_current_step_id});
  })

Any feedback would be greatly appreciated!

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

Sign in to reply to this post.