hi,
i have a database with a blanc design. alle new elements are not related to a mail database at all.
one form contains a document about a person including the birthday.
i'd like to have a web-view similar or same to the one in the mail template to see all birthday entries of all persons.
tasks:
1) i'd like to know which minimum (and if needed how) design elements i need to copy from a mail template to see the notes (viewd by a browser) calender in the web.
the bithday entries in the calender can be made by a notes client, if it's more easy.
problem: the copied design elements shouldn't be larger that about 1.5 mb.
if there are other templates / design elements i can use than form the original mail template it'd be also ok.
2) ideal would be to have an agent that looks in the documents where the birthday is entered (field birthday)
an writing it into the calender.
if this taks (2) is also answered by you, i'll increase the points by 100.
On your birthday form you need at least the following fields:
- DateOfBirth : a date/time field to hold the person's date of birth
- NextBirthDay: a date/time field to hold the person's next birthday. This field is computed using the following formula:
newDate:=@Date(@Year(@Toda
@if(@IsError(newDate); "";
@if(newDate>@Today;
newDate;
@Date(@Year(@Today)+1; @Month(DateOfBirth); @Day(DateOfBirth))
)
);
- Name: a text or names field to hold the person's name
You can include any additional fields you like, but these are the minimum required fields.
There's no field for duration required, we can use a computed column in the view for this.
Now create your calendar view. As sloeber mentioned, you specify in the view properties that this is to be a calendar view.
First column: hidden, sorted ascending, NextBirthDay field
Second column : hidden, formula: 1 (just the value 1)
Third column : sorted ascending, Name field to display the name of the person on your calendar
That's it. If you look at the view now you will see all the birthdays you entered.
Now to update this view every year, you need to write an agent that updates the NextBirthDay fields on all birthday documents.
Schedule this agent to run daily on all documents in the database or on all documents where NextBirthDate<@Today (the latter if there are many documents, you can use this to limit the number of documents to be processed)
Let the agent execute the following formula:
newDate:=@Date(@Year(@Toda
FIELD NextBirthDay:=@if(@IsError
@if(newDate>@Today;
newDate;
@Date(@Year(@Today)+1; @Month(DateOfBirth); @Day(DateOfBirth))
)
);
I'll send you a little sample database you can play around with.
Regards,
JM