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

Question

Question

Retrieve form name to use in lookup/Dynamic default values

asked on June 12, 2014 Show version history

I want to be able to create a table of default values for some forms and load those instead of using the built-in default field.

 

Unless somebody knows of a programmatic way to make changes to default values on the fly. We have some multi-line fields that have some fairly static text that gets used as part of a generated letter. However, from time to time they need to change the default and persist the change. For example, there's statement about office hours, and sometimes those change.

 

The default value table will need to have columns for the form name as well as the field ID. However, I can't seem to find a way to build a query like that.

 

I suppose I have a couple of options. I can write an AJAX service to load the values and then save off any changes as part of the BP. Or I can muck around with the JSON directly, which is obviously not supported.

 

Any thoughts?

0 0

Answer

SELECTED ANSWER
replied on June 12, 2014

You might be able to do this without any scripting:

 

First, you'll need a table such as the one you mentioned with the default field values you want associated with the Form name.

 

 

On each desired form, you can put a hidden field with a default value of the form's name and use this hidden field to perform a lookup to populate the rest of the fields with their default values.

 

 

 

After the form is submitted, have Forms run a service task to kick off a Workflow. This Workflow would check the values of the submitted default fields and compare them to the values in the reference database. If the values have changed (a user edited the defaults) then the workflow can update the default in the database.

0 0
replied on June 12, 2014 Show version history

That's as good an answer as any. Although, I'm not fond of doing wide tables with Field1, Field2, etc.

 

There's enough to this particular project that I actually don't think I'll use Forms, which is kind of disappointing. I was hoping to use Forms to capture some data that will go into system-generated letters. I think I've figured out all the particulars, but it will make the forms themselves rather more convoluted than I'd like.

 

In the past I've done my own dynamically generated fields, and that's what I think I'll do this time.

 

Thanks.

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.