Jeg har denne som jeg kan få til at fungere på det første felt, men den medbringer kun kundenr og installation og ikke StartDate er der nogen der har et godt forslag?
Datofelterne er stort set umulige at udfylde med @UI kommandoer. Jeg gør normalt det at jeg med LotusScript opretter et dokument i databasen, hvor jeg sætter felterne og så bruger NotesUISession.EditDocument til at vise dokumentet.
Jeg har tidlige forsøgt at få dette lotusscript fundet somewhere www til at virke, men det er aldrig lykkeds mig
Sub Click(Source As Button) Dim db As Notesdatabase Dim session As New NotesSession Dim workspace As New notesuiworkspace Dim uidoc As notesuidocument Dim note As notesdocument Dim item As NotesItem Dim startdttm As NotesDateTime Dim enddttm As NotesDateTime Dim window As NotesDateRange Dim names As String Dim dur As Integer Dim username As String
Set uidoc = workspace.currentdocument Set note = uidoc.Document Set item = note.GetFirstItem("Servicetid_accept") Set startdttm = item.DateTimeValue Set item = note.GetFirstItem("service_varighed") Set enddttm = item.DateTimeValue Set window = session.CreateDateRange() Set window.StartDateTime = startdttm Set window.EndDateTime = enddttm names = session.CommonUserName dur = ((enddttm.TimeDifference(startdttm))+86400)/60 freeTime = session.FreeTimeSearch(window, dur, names, True)
' If there is no value for freeTime(0) then that time is already booked - messagebox constants 0=okonly, 4=yesno, 32=question mark icon, 7=no ' If (freeTime(0) Is Nothing) Then ' If Messagebox ("This time is already booked - do you want to double book?", 4 + 32) = 7 Then ' Messagebox "This document has NOT been added to your calendar. ", 0, "Add Canceled" ' Exit Sub ' End If ' End If
Set db = New notesdatabase("", "") Call db.openmail Dim cEntry As New NotesDocument(db) Dim rtitem As Variant Dim itemIcon As NotesItem username = session.UserName cEntry.From = note.From(0) cEntry.Subject = note.EventDescription Set rtitem = note.GetFirstItem("Body") Call rtitem.CopyItemToDocument(cEntry, "kundenr") cEntry.Form = "Appointment" cEntry.AppointmentType = "2" cEntry.tmpWasMailed = "1" cEntry.ExcludeFromView = "D" cEntry.OrgTable = "P0" cEntry.Location = note.Location cEntry.calendarDateTime = note.datelist Set itemIcon = New NotesItem(cEntry, "_ViewIcon", 9) itemIcon.IsSummary = True cEntry.Logo = "stdNotesLtr0" cEntry.StartDate = note.EventStartDate cEntry.EndDate = note.EventEndDate
Du mangler NotesUIWorkspace.Editdocument(optional byval editmode, optional byval notesdocument, optional byval notesdocumentreadonly, optional byval notesdocumentanchor as string, optional byval returnnotesuidocument, optional byval newinstance) as notesuidocument
(og ikke UISession :-)
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.