no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | tech:codecharge:setting_audit_columns [2014/11/15 15:13] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Auto populate CREATE/ | ||
+ | Almost every Codecharge form needs to auto populate create and update audit fields. Here is how it can be done. | ||
+ | |||
+ | ===== CREATE_USER_ID ===== | ||
+ | Steps | ||
+ | - Before Insert (Record) Event | ||
+ | - Add Action - " | ||
+ | - Control Name = CREATE_USER_ID | ||
+ | - Source Type = Session | ||
+ | - Source Name = UserLogin | ||
+ | |||
+ | ===== CREATE_DT ===== | ||
+ | Steps | ||
+ | - (Add another) Before Insert (Record) Event | ||
+ | - Add Action - " | ||
+ | - Control Name = CREATE_DT | ||
+ | - Source Type = Expression | ||
+ | - Source Name = time() | ||
+ | |||
+ | ===== UPDATE_USER_ID ===== | ||
+ | Steps | ||
+ | - Before Update (Record) Event | ||
+ | - Add Action - " | ||
+ | - Control Name = UPDATE_USER_ID | ||
+ | - Source Type = Session | ||
+ | - Source Name = UserLogin | ||
+ | |||
+ | ===== UPDATE_DT ===== | ||
+ | Steps | ||
+ | - (Add another) Before Update (Record) Event | ||
+ | - Add Action - " | ||
+ | - Control Name = UPDATE_DT | ||
+ | - Source Type = Expression | ||
+ | - Source Name = time() | ||
+ | |||
+ | ===== Formatting ===== | ||
+ | Set both CREATE and UPDATE date to the following date format to display the full date with time | ||
+ | < | ||
+ | And to the following for the dbformat | ||
+ | < | ||
+ | |||
+ | ==== Other consideraions ==== | ||
+ | * Make all create userid/date NOT required | ||
+ | * Make all create/ | ||
+ | * Make all field the same size and remove any blank spaces around the controls. Size 20 seems to work well. | ||
+ | * Appreance | ||
+ | * Group all audit fields in one row with four columns | ||
+ | * Delete the date pickers | ||
+ | * Add a blank row about the four column row and label it with " | ||
+ | * Update the Locale for the above as " | ||
+ | |||
+ | ====== Alternate way to auto populate CREATE_USER_ID and CREATE_DT on new record ====== | ||
+ | This method should not be used because it does not set the insert date on the time of insertion. It sets it when the blank record is loaded and the date will not be accurate. The User id on the other hand is fine. | ||
+ | |||
+ | ===== CREATE_USER_ID ===== | ||
+ | In the default value property | ||
+ | < | ||
+ | |||
+ | ===== CREATE_DATE ===== | ||
+ | In the default value property | ||
+ | < | ||