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

Question

Question

Forms: default value bug?

asked on April 1, 2020 Show version history

Hi all,

I'm experiencing an issue where default values are working in preview but not when the process is running. There's also the interesting fact that the default values can be seen in the "default-val" attribute. Note: no custom JS but I am using CSS to put adjacent username/date fields side-by-side.

Edit: meant to state that this is occurring in version 10.4.1.172.

Layout and preview of submission form

Layout and preview of verification form

Verification form in-process (ie, first form submitted, opened this task in my Inbox)

I already tried everything in the 2 most recent Answers posts on this issue (one of them is my own...):

https://answers.laserfiche.com/questions/151519/Forms-Current-User-default-value-issue

https://answers.laserfiche.com/questions/134597/Default-value-currentuser-in-readonly-field-only-works-for-3-of-4-fields

Thanks!

Rob

0 0

Answer

SELECTED ANSWER
replied on April 2, 2020 Show version history

Hi Rob,

Since you have the "Verified by" and "Date Verified" fields on the Submission form, that will give them a blank value before the process goes to the second form. A field's default value will only be assigned to a form that does not already have a value (including a blank string).

If you remove them from the Submission form, it should fill them correctly on the second form.

Edit: Wrong fields, sorry; I was looking at the Inspect screenshot. Do the above for the approval fields (though if this fixes it, you will have to do the same for the others).

0 0
replied on April 2, 2020

Hi Jim,

Thanks for the reply! I could have sworn I'd accomplished something similar in the past but current experience begs to differ.

The process can route (and re-route) to any of 4 stakeholders (including the submitter) in a number of ways and it's important that all stakeholders be able to see who else has been involved in a given instance. Do you have any suggestions for accomplishing this? At this point things aren't looking promising so I've written some JS to assign the value of the 'default-val' as the input value, compose a date, and dump that into the date field, but I'd prefer to stick to out-of-the-box functionality.

Thanks again,

Rob

0 0
replied on April 3, 2020

You could try using one field for the display, which would be on all three of the other forms, and a different field that only shows up where you want to set it to the default value. Then, for the display field on each of the three 'display' forms, set the field calculation to = the set field.

0 0
replied on April 3, 2020

Not a bad idea, thank you for the suggestion. It definitely aligns with my preference for out-of-the-box functionality, but it strikes me as less maintainable than the following JS on the relevant forms:

(function() { 
  $(document).ready(function() {
    var d = new Date();
    var date = d.getDate();
    var month = d.getMonth()+1;
    var current_date = month + '/' + date + '/' + d.getFullYear();
    var name = $('#q7 input').attr('default-val');
  
  
    $('#q7 input').val(name);
    $('#q8 input').val(current_date);
  });
})();

To my mind the way default values currently function in Forms is unintuitive--if a default value is set on a field on only one form and that form is used only for a single user task, the relevant field should be populated with the default value as indicated on the layout when passing through the task. If no defaults are specified, the field (variable) should remain unchanged, whether it is currently an empty string or otherwise. Hopefully this will be changed in the future!

1 0
replied on April 3, 2020

There are certainly uses for it as-is, but I agree, I think there should be an 'override existing' option for the default value.

0 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.