Tip: Add to forms a courtesy display of the record's Created/Modified user & date
Sometimes it is helpful, when on a Form, to know the AddedBy or last
ModifiedBy user and date. (Without having to open the record summary or
a view that has these columns.)
Example:
Simply create one function, and then for each form desired, add an
Add Note field, and 1 line to OnEdit/OnLoad (takes about 1 minute per
form :-)
Function: Input is 4 params for created/edited by/date, output is
a string containing an <hr> plus HTML table with the data. You
can modify the HTML to your liking and since it is a function, modifying
it affects all forms on which it is used.
- string
FUNCS.created_edited(string added, date added_dt, string mod, date
mod_dt)
- {
-
res = "<hr><table cellpadding='1'
cellspacing='0' border='0' bgcolor='#eeeeee'
style='font-size: 8pt;'><tbody>";
-
res = res +
"<tr><td><i>Created:</i></td><td> </td><td>"
+ input.added +
"</td><td> </td><td>"
+ input.added_dt + "</td></tr>";
-
res = res +
"<tr><td><i>Edited:</i></td><td> </td><td>"
+ input.mod +
"</td><td> </td><td>"
+ input.mod_dt + "</td></tr>";
-
res = res + "</tbody></table>";
-
return res;
- }
In the desired form(s):
- place an "Add Note" field where you want the
display to be, perhaps the bottom of the form. I name mine
"created_edited_txt". The default text that you define
for the field can be anything you want, perhaps simply an
<hr>, since this text will only show when adding a new
record. ie, when *editing* a record, the table with data will
show instead.
- In the form workflow OnEdit
/ OnLoad, add the line below. (Make changes if you used a
different function namespace, or different name for your Add
Note field.) As you can see, this will replace the
default text for the "Add Note" field with the
output of the function, which will be the HTML table
with the created/edited data.
- input.created_edited_txt
= thisapp.FUNCS.created_edited(input.Added_User, input.Added_Time,
input.Modified_User, Modified_Time);
(This could instead have used a multiline text field, but IMO
"add note" field type looks better if for no other reason it
does not display its fieldname. A downside of the Add Note field type
is that it can't be defined to be seen by "Admin Only" vs. "Everyone".)
You could add other info such as the record's ID, such as to
make it a bit easier for users in cases where they sometimes need to
learn the ID of a record.
And, deluge-adjusted "add note" fields can also be used for
other helpful things on a form, including dynamic clickable links. Such
as the post here
.
Suggestions/improvements welcome!