For “Reporting” purpose, we require to extract some values from the Status_Log field.I need to, display them nicely in a view (I’m working on this), and, instead of current situation, whereby status_log is updated every time document is saved (even if Status is the same), it should now only update if the status actually changes. (This should make it easier to report on, looks nicer, and is a more accurate reflection of what the status_log is supposed to be doing)…
Example of small status log:
Generic Notes Developer 08/11/2006 Open: Draft
Generic Notes Developer 08/11/2006 Open: Draft
(taken from the field).
Field is NOT multivalued. Field is having the formula:
FIELD Status_Log := Status_Log;
FIELD Status:=Status;
@SetField(“Status_Log”;@Name([CN];@UserName) + " "+@Text(@Today) + " "+Status +@NewLine+Status_Log)
Then, I tried to add checking. I want it to look in the Status_Log field, pull out the last entered value, pull back only the status, and compare this with the value in the status field (maybe there is a better way !!??).
So - I tried using @Right:
FIELD Status_Log := Status_Log;
FIELD Status:=Status;
TempStatus:=@Right(Status_Log;"7 ");
@If(Status=TempStatus;@Return(“”);
@SetField(“Status_Log”;@Name([CN];@UserName) + " "+@Text(@Today) + " "+Status +@NewLine+Status_Log))
But it still always sets the status.
So I set up test fields, with all combinations of @Right, @Left, @RightBack, @LeftBack, @Middle, @MiddleBack,
but nothing I do seems to just pull back
Open: Draft
from the first line…
One question that it occours is, is there some way of JUST selecting the first line? Then I could search that for the string I want and go from there…I tried this one:
@Right(Status_Log;@Newline)
or also with
@Left(Status_Log;@Newline)
But it returns too much…Any ideas??