N
Nevercrashnow
Wanted to share a couple of simple tips from a project I did.
1. Create a hidden text field in your data structure called formName. Put
the name of the form in as the value with an underscore on the end. When you
are setting up your submit options you can use the concat function to create
the file name and prefix it with this field. So for example say we have our
formName hidden data field, an employeeName field and then a reviewDate
field. Concat that together to get an automatic file name generated like
Review_JohnSmithDate.
2. Create two hidden fields on your form: One called submitID and one
called currentUserID.
From tools - form options - open and save - rules make a rule that
populates the currentUserID field with username(). So, everytime the form is
opened it will grab the current user's windows account name and throw it in
that field.
Now when setting up your submit options pick - submit by rules - first rule
should write the value of username() to the submitID field. This will write
the windows account name of the person who pressed submit into that field.
Next rule action - submit using data connection - setup the data connection
for your form library like normal.
Practical Application:
Since you are recording the submitters ID in a field at the time of
submission and are grabbing the user ID of the person when they open up a
filled out form to read it, you can take a field on your form's display area
and apply conditional formatting like this: if field currentUserID does not
equal submitterID then "read only" or "hide this control"
Net effect is that if anyone other than the person who submitted the form
opens a filled out form you can lock down certain form fields from editing.
Why not just use roles for this? If you are using browser based forms roles
are not natively supported plus this is specific to one user account
[submitID] rather than a role which might have multiple people in it.
1. Create a hidden text field in your data structure called formName. Put
the name of the form in as the value with an underscore on the end. When you
are setting up your submit options you can use the concat function to create
the file name and prefix it with this field. So for example say we have our
formName hidden data field, an employeeName field and then a reviewDate
field. Concat that together to get an automatic file name generated like
Review_JohnSmithDate.
2. Create two hidden fields on your form: One called submitID and one
called currentUserID.
From tools - form options - open and save - rules make a rule that
populates the currentUserID field with username(). So, everytime the form is
opened it will grab the current user's windows account name and throw it in
that field.
Now when setting up your submit options pick - submit by rules - first rule
should write the value of username() to the submitID field. This will write
the windows account name of the person who pressed submit into that field.
Next rule action - submit using data connection - setup the data connection
for your form library like normal.
Practical Application:
Since you are recording the submitters ID in a field at the time of
submission and are grabbing the user ID of the person when they open up a
filled out form to read it, you can take a field on your form's display area
and apply conditional formatting like this: if field currentUserID does not
equal submitterID then "read only" or "hide this control"
Net effect is that if anyone other than the person who submitted the form
opens a filled out form you can lock down certain form fields from editing.
Why not just use roles for this? If you are using browser based forms roles
are not natively supported plus this is specific to one user account
[submitID] rather than a role which might have multiple people in it.