Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: mgeidl am 29.01.07 - 10:57:00

Titel: Feld im names.nsf ändern
Beitrag von: mgeidl am 29.01.07 - 10:57:00
Hallo,

wir haben bei uns InstallPump im Einsatz und möchten ein Feld im names.nsf (Arbeitsumgebung) mit diesem Tool ändern. Wir haben das Script umgeschrieben, aber leider wird das Feld nicht geändert, sondern neu (somit haben wir zwei) mit dem gewünschten Wert hinzugefügt.

Könnte sich BBBIIIITTTTTEEEEE wer erbarmen und das Script mal durchsehen, warum das so ist? DANKE und LG Marietta

Option Explicit
' this script loops through all of the location documents and sets the internet address to
' the value assigned to the "iaddress$" variable

Sub Main
   Dim NoteCount&, i&, ExhaustiveNameLockup$
   Dim LocationName$
   On Error GoTo main_err
   
   IPLogCreate "****************************************************"
   IPLogCreate "About to modify location documents"
   IPLogCreate "****************************************************"
   

   ExhaustiveNameLockup$ = "1"

   
   ' open the local NAB
   NoteCount& = IPNotesOpenView("", "NAMES.NSF", "($Locations)", "*")
   
   ' make sure that documents have been returned.
   If NoteCount& < 0 Then
      IPLogError "Unable to modify Location documents." + Chr$(13) + IPNotesGetLastError()
      Exit Sub
   End If
   
   'loop
   For i& = 0 To NoteCount& - 1
      If IPNotesOpenNote(i&) Then
         IPLogError "Unable to modify Location documents." + Chr$(13) + IPNotesGetLastError()
         IPNotesCloseDatabase
         Exit Sub
      End If
      
      ' find the current location name
      LocationName$ = IPStringLeft(IPNotesGetTextField(i&, "Name"), Chr$(0))
      'MsgBox "Editing location '" & LocationName$ & "'"
      
      IPNotesSetTextField i&, "ExhaustiveNameLockup", ExhaustiveNameLockup$
      

      IPNotesUpdateNote i&
      IPNotesCloseNote i&
   Next
   
   IPNotesCloseDatabase   
   IPNotesDisconnect()
   IPLogCreate "All Location documents updated sucessfully."
   
   Exit Sub
   main_err:
   IPLogCreate "Error modifying location documents:  " & Err.Number & " " & Err.Description
   Exit Sub
End Sub
Titel: Re: Feld im names.nsf ändern
Beitrag von: klaussal am 29.01.07 - 11:02:50
Lass doch mal den Debugger mitlaufen und schau nach, wo + wie er das Feld ändert. Vielleicht gibt es da schon Auffälligkeiten(Gross-/Kleinschreibung, etc).
Titel: Re: Feld im names.nsf ändern
Beitrag von: eknori (retired) am 29.01.07 - 11:08:27
Ich würde hier einmal den leicht zu erkennenden Tippfehler verantwortlich machen
Titel: Re: Feld im names.nsf ändern
Beitrag von: klaussal am 29.01.07 - 11:10:06
 :P
Titel: Re: Feld im names.nsf ändern
Beitrag von: mgeidl am 29.01.07 - 11:14:04
Hm, scheint, als müßt ich wieder mal zum Augenarzt, oder aber nur für Guru´s is der Tippfehler leicht zu erkennen??
Titel: Re: Feld im names.nsf ändern
Beitrag von: koehlerbv am 29.01.07 - 11:22:53
Lockup -> Lookup.

Bernhard
Titel: Re: Feld im names.nsf ändern
Beitrag von: klaussal am 29.01.07 - 11:25:17
Spätestens, wenn frau sich die Dokumenteneigenschaften angesehen hätte, wäre es aufgefallen ,dass es zwei Felder mit fast  ;D identischem Namen gibt.
Titel: Re: Feld im names.nsf ändern
Beitrag von: mgeidl am 29.01.07 - 11:26:44
chef hat gemeint, daß er den feldnamen rauskopiert hat. so genau hab ich das net gesehen.

ups, tschuldigung und DANKE