RF_Audit ( LogField ; Watchlist)
Rate this function: Average rating: 3.5 (8 votes) Discuss this Custom Function
Peter Vinogradov, Peter Vinogradov Consulting
http://petervinogradov.com
Prepends an audit log of changes to fields in Watchlist to LogField
Sample Input:
| RF_Audit ( Data_Audit; "tf_Reps[2] & nf1") |
|
Sample Output:
[4/28/2007 12:56:19 AM] User Admin ------ <tf_Reps[2] > to |World| from |Hello|
[4/28/2007 12:56:19 AM] User Admin ------ <nf1 > to |14| from |12|
{formatting not shown} |
|
Description:
Inspired by Ray Cologon's SuperLog technique, this recursive CF is used to capture changes to specified fields. Typically, the "LogField" is a text field stored in the table you want to audit. It is defined as an auto-entry calc that triggers this CF whenever modifications are made to fields in the watchlist.
This autoentry calc requires a bit more fuss than the SuperLog method, since you have to explicitly define field triggers AND a string of Watch fields to pass to the function. In the example above, Data_Audit would be defined as follows:
-------------
Let (
[
Triggers = tf_Reps[2] & nf1;
WatchList = "tf_Reps[2] & nf1";
];
RF_Audit ( Data_Audit; WatchList)
)
-------------
The tradeoff is that the function is not context-dependent, and therefore no separate logic is needed for modifications made by script.
This function also includes formatting logic for the log.
Function has not been seriously field tested or put up against a large watchlist so it may turn out to be slow under load. Feedback appreciated (pvino at optonline.net)
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
edit it
Discuss:There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:
|
Newest Custom Functions:
| 1. |
TimeCodeCalculations ( TCSMPTE01 ; TCSMPTE02 ; FrameRateOr ; FrameRateNew ; CalcType ) |
| |
(Sat, Sep 04, 9:31pm) |
| 2. |
Fedex_Country ( Country ) |
| |
(Fri, Sep 03, 11:07am) |
| 3. |
GetResultParameter( ParameterName ) |
| |
(Wed, Aug 25, 8:32am) |
| 4. |
GetListParameter ( ParameterList ; ParameterName ) |
| |
(Wed, Aug 25, 8:25am) |
| 5. |
Standard_Deviation( Field ; MaxLoopCount ; StartIndex ; StdDeviation ; ArithMeanValue ) |
| |
(Tue, Aug 24, 10:57am) |
| 6. |
Arithmetic_Mean ( Field ; MaxLoopCount ; StartIndex ; MeanValue ) |
| |
(Tue, Aug 24, 10:51am) |
| 7. |
Age ( Birth; theDate; Format ) |
| |
(Fri, Aug 20, 9:50am) |
| 8. |
Power ( x ; y ) |
| |
(Thu, Aug 19, 5:56am) |
 |
|