Create list of dates for Date/Time field
Create list of dates for Date/Time field
(OP)
I'm a Notes design newbie - I'm developing a quoting system for our company and the quote document passes through various "status" as it is processed. As it passes into each status the status date is recorded in a Date/Time field for each status.
Occasionally there may be a need for it to pass back through the same status again - instead of the previous status date being overwritten I would like it to be appended to the existing date in that field.
What I was thinking was to save a list of dates in a date time field? So if there was an existing value in the date/time field, the new date would be added to the list? Is this possible? If so how would I program it?
Occasionally there may be a need for it to pass back through the same status again - instead of the previous status date being overwritten I would like it to be appended to the existing date in that field.
What I was thinking was to save a list of dates in a date time field? So if there was an existing value in the date/time field, the new date would be added to the list? Is this possible? If so how would I program it?
RE: Create list of dates for Date/Time field
Take a look at this code :
@if(!@isdocbeingsaved;fieldname;
@if(fieldname="";newvalue;fieldname:newvalue)
)
As you admit to being a Notes beginner, I'll explain what the code does.
The nature of a Computed field is that its formula recomputes every time the document is refreshed, and when the doc is saved.
Thus, I first check if the document is being saved, since there is no sense to update the formula before then.
If that is not the case, the formula returns the current value of the field - so nothing happens.
If the document is being saved, the code goes to the ELSE portion of the first @If, which is another @if.
This time, I check if the field is empty. If it is, then I just use the value I want to insert.
If it is not, I use the colon sign to concatenate the new value with the data already contained in the field. The colon sign makes the concatenation multi-valued (as opposed to a simple string addition).
There, I hope this helps.
Pascal.
RE: Create list of dates for Date/Time field
TodayDate := @Now;
@if(!@isdocbeingsaved;ApproveDate;
@if(ApproveDate="";TodayDate;ApproveDate:TodayDate)
)
;
I get a single date in the field but cant seem to get the concatenated date to show or store - is there anything I need to do to display a list of dates?
The field type is Date/Time is this a problem, should it be something else? Is there anything I need to do to display the list value?
I originally had the "Compute After Validation" property checked for the field and this code in the value:
@If(QuoteStatus!="Approved";ApproveDate;@If(ApproveDate="";@Now;ApproveDate:@Now));
It appeared to do the same thing - ie. only store one date value? Thanks for the help so far...
RE: Create list of dates for Date/Time field