Agent qui coince le déroulement d'une formule

Publié:
24 Oct 2003 à 09:12
par sandrine
Bonjour, j´ai un bouton d´action, qui mets à jour des champs à partir du masque où il est appelé et il lance 2 macros (agent en LS) le 1er met à jour un document en y modifiant des champs, l´autre écrit une entrée d´agenda. Mon pb vient de l´agent qui inscrit l´entrée d´agenda, en fait une fois qu´il s´est excécuté il empêche tous les autres traitement contenu dans la formule. Le Code LS je l´ai repiqué d´une base de la Sandbox, j´ai suivi une formation LS la semaine dernière et on a eu un exemple de création d´un doc à partir d´un masque mais à travers un bouton d´action pas à travers un agent; je pensai qu´il devait réagir pareil mais ce n´est pas le cas. Ce qui est encore plus bizarre c´est qu´il faille éditer en avant plan le doc pour pouvoir l´enregistrer. voici le code qu´il y a pour l´agent agenda Sub Initialize ´_ Initialisation du document courant Dim ws As New NotesUIWorkspace Dim curdoc As NotesDocument Set curdoc = ws.currentdocument.document ´_Initialisation & Récupération des dates de congés souhaitées Dim DateDebut As NotesDateTime Dim DateFin As NotesDateTime Dim ItemDebut As NotesItem Dim ItemFin As NotesItem Set ItemDebut = Curdoc.GetFirstItem("v_dd") Set ItemFin = Curdoc.GetFirstItem("v_df") Set DateDebut = ItemDebut.DateTimeValue Set DateFin = ItemFin.DateTimeValue ´_Création entrée Agenda Dim s As New NotesSession Dim db As NotesDatabase Set db = s.GetDatabase("Mail/Meffre",Curdoc.r_base(0)) Dim doc As NotesDocument Set doc = db.createDocument ´Msgbox "ok creation" doc.form = "Appointment" ´Msgbox "ok form" doc.AppointmentType = "2" ´Msgbox "ok type" doc.Subject = "Congé" doc.StartDateTime = DateDebut.LsLocalTime doc.EndDateTime = DateFin.LsLocalTime doc.Duration = CurDoc.Caldays(0) doc.ExcludeFromView = "D" ´_ Affichage Entrée Agenda autoreload = False Dim Uidoc As NotesUIDocument Set Uidoc = ws.EditDocument(True,doc) Call UIDoc.Save Call UIDoc.Close autoreload = True End Sub Si quelque pourrait m´aider ? Merci[%sig%]
Re: Agent qui coince le déroulement d'une formule

Publié:
27 Oct 2003 à 16:44
par sandrine
Je reformule ma question, histoire de voir si quelqu'un a la réponse.Est-ce que quelqu'un a déjà créer une entrée d'agenda à travers un agent et si oui, aurait-il la gentillesse de me dire comment ? s'il a rencontré des soucis de quels types et comment il les a résolu?Merci beaucoup.Je bute sur ce fichu machin qui s'il tourne tout seul rien a dire mais coupler ça pose soucis.[%sig%]
Re: Agent qui coince le déroulement d'une formule

Publié:
30 Oct 2003 à 16:36
par Dorothée
Hello,J'ai développé une base qui permet de poser ses congés payés. Si ta demande a été acceptée alors l'agent qui tourne chaque nuit va t'inscrire ton congé dans ton agenda.Attention, ceci est le code pour un agenda en V5 (different de la V4!). J'ai été obligée de spécifier tous ces champs pour que cela soit compatible avec les palms des utilisateurs, mais seulement la moitié suffisent pour l'agenda notes seul.Voici:doc=> la demande de congéseventdoc=> l'evenement dans la boite mail de la personne qui a fait la demande.Set eventdoc=New notesdocument(dbevent)Set Form = New notesitem(eventdoc,"Form","Appointment")Form.IsSummary =TrueSet busyname = New notesitem(eventdoc,"$BusyName",doc.RequesterName(0),NAMES)busyname.IsSummary =TrueSet busypriority = New notesitem(eventdoc,"$BusyPriority","1")busypriority.IsSummary=Truebusypriority.IsNames=TrueSet altprincipal = New notesitem(eventdoc,"$AltPrincipal",doc.RequesterName(0))altprincipal.IsSummary=TrueSet csversion = New notesitem(eventdoc,"$CSVersion","2")csversion.IsSummary=TrueSet langchair = New notesitem(eventdoc,"$LangChair","")langchair.IsSummary=TrueSet langprincipal = New notesitem(eventdoc,"$LangPrincipal","")langprincipal.IsSummary=TrueSet smtp = New notesitem(eventdoc,"$SMTPKeepNotesItems","1")smtp.IsSummary=TrueSet webflags = New notesitem(eventdoc,"$WebFlags","J")webflags.IsSummary=TrueSet alarm = New notesitem(eventdoc,"Alarms","")alarm.IsSummary=TrueSet expandgroup = New notesitem(eventdoc,"$ExpandGroups","3")expandgroup.IsSummary = TrueSet PublicAccess = New notesitem(eventdoc,"$PublicAccess","1")PublicAccess.IsSummary= TrueverifFin= doc.End_Date(0)+" 20:00:00"Set NoPurge = New notesitem(eventdoc,"$NoPurge",Cdat(veriffin))NoPurge.IsSummary= TrueSet BookFreeTime = New notesitem(eventdoc,"BookFreeTime","")BookFreeTime.IsSummary= TrueSet Location = New notesitem(eventdoc,"Location","")Location.IsSummary= TrueSet Categories = New notesitem(eventdoc,"Categories","")Categories.IsSummary= TrueSet CopyTo = New notesitem(eventdoc,"CopyTo","")CopyTo.IsSummary= TrueCopyTo.IsNames= TrueSet Encrypt = New notesitem(eventdoc,"Encrypt ","0")encrypt.IsSummary= TrueSet OrgConfidential = New notesitem(eventdoc,"OrgConfidential","")OrgConfidential.IsSummary= TrueSet SendTo = New notesitem(eventdoc,"SendTo","",NAMES)SendTo.IsSummary= TrueSet CHAIR = New notesitem(eventdoc,"CHAIR",doc.RequesterName(0))CHAIR.IsSummary= TrueSet itemFrom=New notesitem(eventdoc,"From",doc.RequesterName(0))itemFrom.IsSummary = TrueitemFrom.IsAuthors=TrueSet Principal=New notesitem(eventdoc,"Principal",doc.RequesterName(0))Principal.IsSummary = TrueSet AppointmentType=New notesitem(eventdoc,"AppointmentType","2")AppointmentType.IsSummary = TrueSet Repeats=New notesitem(eventdoc,"Repeats","")Repeats.IsSummary = TrueSet Ressources=New notesitem(eventdoc,"Ressources","")Ressources.IsSummary = TrueRessources.IsNames = TrueSet RoomToReserve=New notesitem(eventdoc,"RoomToReserve","")RoomToReserve.IsSummary = TrueRoomToReserve.IsNames = TrueSet SaveOptions=New notesitem(eventdoc,"SaveOptions","")SaveOptions.IsSummary = TrueSet I_Body=New notesitem(eventdoc,"Body",doc.Comments(0))I_Body.IsEncrypted = TrueSet blindcopyto = New notesitem(eventdoc,"BlindCopyTo","")blindcopyto.IsSummary=Trueblindcopyto.IsNames=TrueSet EndDate = New notesitem(eventdoc,"EndDate",doc.End_Date(0))EndDate.IsSummary=TrueSet EndTime = New notesitem(eventdoc,"EndTime",Cdat(doc.End_Date(0)+" 20:00:00"))EndTime.IsSummary=TrueSet EnterCopyTo = New notesitem(eventdoc,"EnterCopyTo","")EnterCopyTo.IsSummary=TrueEnterCopyTo.IsNames = TrueSet EnterBlindCopyTo = New notesitem(eventdoc,"EnterBlindCopyTo","")EnterBlindCopyTo.IsSummary=TrueEnterBlindCopyTo.IsNames=TrueSet EnterSendTo = New notesitem(eventdoc,"EnterSendTo","")EnterSendTo.IsSummary=TrueEnterSendTo.IsNames=TrueDim nombre As Integernombre%=doc.Days_Elapsed(0)nombre% = nombre% - 1Redim myList(nombre%) As VariantDim verifDeb6 As New NotesDateTime ("")Set verifDeb6=New notesdatetime(doc.Start_Date(0))mylist(0)=Datevalue(doc.Start_Date(0)) For counter% = 1 To nombre%Call verifDeb6.AdjustDay(1)mylist(counter%) =Datevalue(verifDeb6.dateonly)Next Set notesItem1 = New notesitem(eventdoc,"CalendarDateTime",mylist)notesitem1.IsSummary=TrueverifFin= doc.End_Date(0)+" 20:00:00"Dim dateTime4 As NotesDateTimeSet dateTime4 = New NotesDateTime( "20:00:00")Set notesItem4 = New notesitem(eventdoc,"appendEndTime",dateTime4)notesItem4.IsSummary=Trueverifdeb=doc.Start_Date(0) + " 04:00:00"Dim dateTime5 As NotesDateTimeSet dateTime5 = New NotesDateTime( "04:00:00")Set notesItem5 = New notesitem(eventdoc,"appendStartTime",dateTime5)notesItem5.IsSummary = TrueverifFin= doc.End_Date(0)+" 20:00:00"Set date2 = New notesitem(eventdoc,"EndDateTime",Cdat(verifFin))date2.IsSummary = TrueSet exclude=New notesitem(eventdoc,"ExcludeFromView","D")Call exclude.appendtotextlist("S") exclude.IsSummary = TrueSet ViewIcon = New NotesItem(eventdoc, "_ViewIcon", 9)ViewIcon.IsSummary = TrueSet ORGTABLE = New NotesItem(eventdoc, "ORGTABLE", "P0")ORGTABLE.IsSummary = Trueverifdeb=doc.Start_Date(0)+" 04:00:00"Set StartDate = New NotesItem(eventdoc, "StartDate", Cdat(verifdeb))StartDate.IsSummary = TrueSet StartDateTime = New NotesItem(eventdoc, "StartDateTime", Cdat(verifdeb))StartDateTime.IsSummary = TrueSet Subject = New NotesItem(eventdoc, "Subject", "Congés")Subject.IsSummary = TrueSet AtlChair = New notesitem(eventdoc,"AltChair",doc.RequesterName(0))AtlChair.IsSummary=TrueSet Logo = New notesitem(eventdoc,"Logo","stdNotesLtr0")Logo.IsSummary=TrueSet MailFirstPass = New notesitem(eventdoc,"MailFirstPass","1")MailFirstPass.IsSummary=TrueSet MailOptions = New notesitem(eventdoc,"MailOptions","0")MailOptions.IsSummary=TrueSet Sequencenum = New notesitem(eventdoc,"Sequencenum",1)Sequencenum.IsSummary=TrueSet tmpNoActionBar = New notesitem(eventdoc,"tmpNoActionBar","")tmpNoActionBar.IsSummary=TrueSet tmpOEMClient = New notesitem(eventdoc,"tmpOEMClient","")tmpOEMClient.IsSummary=TrueSet Sign = New notesitem(eventdoc,"Sign","0")Sign.IsSummary=TrueSet StartTime = New notesitem(eventdoc,"StartTime",Cdat(doc.Start_Date(0)+" 04:00:00"))StartTime.IsSummary=TrueSet tmpOwnerHW = New notesitem(eventdoc,"tmpOwnerHW","1")tmpOwnerHW.IsSummary=TrueSet WebCategory = New notesitem(eventdoc,"WebCategory","")WebCategory.IsSummary=TrueSet WebDateTimeInit = New notesitem(eventdoc,"WebDateTimeInit","1")WebDateTimeInit.IsSummary=TrueCall eventdoc.save(True,False)Print "envoi event"
Re: Agent qui coince le déroulement d'une formule

Publié:
03 Nov 2003 à 11:31
par sandrine
Merci, je vais essayé ça[%sig%]