darylhansen

Ray's UltraLog Mod

Discussion created by darylhansen on Aug 9, 2012
Latest reply on Aug 27, 2012 by darylhansen

I was wondering if anyone has figured out how to modify Ray's UltraLog Custom Function to not track field changes when the field was previosuly empty. I have no need to know what a field is, if it was previosuly empty, because it is a given. I have beat my head over this thing for hours and can;t seem to figure it out. I thought it would be simple.

 

Thanks.

 

____________________________________________________________

 

// SYNTAX: UltraLog ( LogField; ModTime; FieldsToLog )

// ORIGIN: http://www.nightwing.com.au/FileMaker

// NOTES: Transactional (IWP Compatible) Audit Log Function.

// VERSION: 1.0v4

// © 2009 Ray Cologon, NightWing Enterprises, Melbourne, Australia

 

 

Case(Prefs::LogSetting= "On" and ValueCount(FieldsToLog) and not $ClearLogPermit;

Let([

Fnm = GetValue(FieldsToLog; 1);

Pref = Position(LogField; " " & Fnm & " "; 1; 1);

Pst = Position(LogField; " -» "; Pref; 1) + 4;

Pnd = Position(LogField & ¶; ¶; Pref; 1);

Pval = If(Pref; Middle(LogField; Pst; Pnd - Pst); "[---]");

Fval = GetField(Fnm);

Sval = Substitute(Fval; ¶; "‡");

Nval = If(Length(Fval); Sval; "[null]");

vInit = Pref = 0 and IsEmpty(Fval);

Prep = Exact($ClearLogPermit; "0");

MTm = Get(CurrentHostTimeStamp)];

If(not Exact(Pval; Nval) and not vInit;

TextStyleAdd(TextColor(

GetAsDate(MTm) & " " & GetAsTime(MTm) & " " &

If(Prep; "[Log Prep]"; Get(AccountName)) & " " &

Fnm & " " & Pval & " -» " & Nval & ¶; Prep*11776947); Prep*Italic)) &

UltraLog(LogField; ModTime; RightValues(FieldsToLog; ValueCount(FieldsToLog) - 1))

);

LogField

)

Outcomes