Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create list of dates for Date/Time field

Status
Not open for further replies.

HighLife

Programmer
Jun 17, 2003
12
0
0
AU
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?
 
I suppose your field is Computed (as well it should be).
Take a look at this code :

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.
 
OK, this is what I have which I thought should work but it doesnt appear to, the field name is ApproveDate:

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:mad:Now));

It appeared to do the same thing - ie. only store one date value? Thanks for the help so far...
 
Did you check multivalue in the field properties panel ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top