Domino 9 und frühere Versionen > Entwicklung

Agent funktioniert nicht

<< < (2/3) > >>

robertpp:
die "to do" ansicht ist die Default view in der ich arbeite!!
Aber sonst hab ihr ab script keinen fehler gefunde?
ich glaub nämlich das mit dem Code:

Do Until doc Is Nothing
      If Isempty (doc.Umstellungsgrund) Then
         umstellgrund =" "
      Else
         umstellgrund = doc.Umstellungsgrund(0)
      End If

irgendwas nicht passt!! wenn im Umstellungsgrund  nichts drinnen steht dann hat er mir den code abgebrochen! und wenn ich hier:
umstellgrund = doc.Umstellungsgrund(0)
nicht direkt auf array (0) zugreife dann geht es auch nicht!!!

robertpp

ata:
... man kann das auch über das Feld abprüfen

If doc.HasItem("Feldname") Then...

... wenn ein Feld existiert, dann ist es immer als Array ansprechbar, und mit

If Fulltrim(Cstr(doc.Feldname(0))) = "" Then...

... kann man überprüfen, ob auch wirklich nichts drin war...

ata

robertpp:
Ich glaub ich weiß eines der probleme warum das nicht geht!! ich hab aus dem Richtextfeld "Umstellungsgrund" ein Textfeld gemacht und da liegt jetzt das problem!! Ich hab auch schon probiert mit "computedwithform" das feld zu aktualisieren aber bei machen docs geht das nicht!! Zweite variante was ich probiert habe ist das doc im forntend zu öffnen und dann wieder speichern das geht aber auch nicht bei allen docs! jetzt weiß ich nicht mehr weiter!!
gibt es sonst noch eine möglichkeit das feld in ein textfeld umzuwandeln?
robertpp

ata:
... das Feld initialisieren

Dim ws As New NotesUIWorkspcae
Dim docThis As NoteDocument
Dim rtItem As NotesRichtTextItem
Dim sText As String

Set docThis = ws.CurrentDocumentDocument
Set rtItem = docThis.GetFirstItem("FeldName")
If rtItem.Type = 1 Then ' # es handelt sich um ein Richtextfeld
    sText = rtItem.Text
    Call rtItem.Remove
    doc.Feldname = sText
    doc.IsSummary = True
End If

ata

robertpp:
Ich hab das ganze jetzt so erweitert ! wenn bei ersten durchlaufen das feld kein RTF ist dann springt er mir zu nextdoc: aber wenn beim zweiten durchlaufen das feld wieder kein RTF ist dann gibt er mir Type Missmatch zurück!!
Es ist nämlich so das manche doc's das Feld schon als Textfeld gespeichert haben!!
   Dim s As New NotesSession      
   Dim doc As NotesDocument
   Dim db As NotesDatabase   
   Dim rtItem As NotesRichTextItem
   Dim sText As String
   Dim view As NotesView
   Set db =s.CurrentDatabase      
   Set view = db.GetView("To Do")      
   Set doc = view.GetFirstDocument
   On Error Goto nextdoc
   Do Until doc Is Nothing   
      
      Set rtItem = doc.GetFirstItem("Umstellungsgrund")
      If rtItem.Type = 1 Then ' # es handelt sich um ein Richtextfeld
         sText = rtItem.Text
         Call rtItem.Remove
         doc.Umstellungsgrund = sText
         doc.IsSummary = True
      End If
      Call doc.Save(True, False)                     
nextdoc:
      Set doc = view.GetNextDocument(doc)
   Loop
was mach ich falsch?
robertpp
   

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln