Link to home
Start Free TrialLog in
Avatar of RichardStarkey
RichardStarkey

asked on

Adding documents to Calendar also creates draft document


Hi Al,
I've a bit of an issue.  When someone has a travel request approved in a database the idea is that they can click a button and it will copy the details over to a calender entry.  There's two problems at the moment.

The first one is that I am creating one document in the Calender for each day of the travel request.  Ideally I want to be able to create one document for all days much like a normal Calender entry.

Secondly, every document I create is getting added to the Calender fine.  However, an entry is also being added to the users draft folder so if someone is away for 14 days they are getting 14 draft documents added to their draft folder as well as their calender.

Any ideas?

Thanks.
Avatar of SysExpert
SysExpert
Flag of Israel image

Without seeing the code, I would suggest either deleting the Drafts or trying not to save them in the first place.

You may need to use backend rather than UI code to do this.

I hope this helps !
Avatar of marilyng
marilyng

Hi RichardStarkey,
Here is the selection formula for the DRAFT view.  Make sure the documents you create don't fall into the formula :)
SELECT PostedDate = "" & $MessageType = "" & @IsNotMember("D" : "A"; ExcludeFromView) & ISMAILSTATIONERY != 1 & Form != "Group" & Form != "Person"

add an Excludefromview="D","A"

d=discussion, a=all

Regards!
Avatar of RichardStarkey

ASKER



Basically, the code finds the local mail file and creates a document.  It then sets up a few of the basic document fields.  The following is a section of the code...

Set appt = maildb.CreateDocument
appt.Form = "Appointment"
appt.MeetingType = "1"
appt.AppointmentType = "0"            
appt.OrgConfidential = "0"
Set iconitem = New NotesItem(appt , "_ViewIcon" , 160)
iconitem.IsSummary = True
Call appt.ComputeWithForm(False,False)
Call appt.ReplaceItemValue("$PublicAccess", "1")
Call appt.save(True,False)


There's additional code for setting up the start date and end date.  I looked at the view selection formula of the draft view and couldn't really figure out what additional field (and what additional field value) I would have to add to the above to stop the document appearing in draft as well?
ASKER CERTIFIED SOLUTION
Avatar of marilyng
marilyng

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you!
Oops, did I say, "calendar view?"  sheesh, I meant draft view.  Thanks for the points.