Domino 9 und frühere Versionen > Entwicklung

Probleme mit verschachtelter @IF

(1/2) > >>

Kibris:
Hallo

Ich befasse mich relativ neu mit Notes Formula und habe nun das Problem,
dass ich eine bestehende Action in Formula verändern muss.

Der bestehende Code prüft, ob auf dem Form bei Accounts die 5 Option gewählt wurde, wenn ja ob das Feld "OSDCreated" bereits einen Wert enthält. Das selbe macht der Code auch für die 3. Ich müsste nun die Formel so verändern, dass zusätzlich geprüft wird, ob auch die Option 4 gewählt wurde (und ein entsprechendes Feld prüfen).


@If(@Contains(Accounts;"5");
      @If(OSDCreated="";
         @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @MailSend(localis;"";"";"CS3 Account Created for user "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]));

@If(@Contains(Accounts;"3");
      @If(VPNCreated="";
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @MailSend(localis;Manager;"";"CS3 Account Created for user "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]));
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @SetField("Status";90);
               @SetField("Update";"Y");
               @MailSend(localhr:Manager;localis;"";"Completed User Request for "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
            @Prompt([OK];"Info";"User creation completed. HR department is now informed");
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow])));
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @SetField("Status";90);
               @SetField("Update";"Y");
               @MailSend(localhr:Manager;localis;"";"Completed User Request for "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
            @Prompt([OK];"Info";"User creation completed. HR department is now informed");
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]))
   ));
      @If(@Contains(Accounts;"3");
      @If(VPNCreated="";
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @MailSend(localis;"";"";"CS3 Account Created for user "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]));
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @SetField("Status";90);
               @SetField("Update";"Y");
               @MailSend(localhr:Manager;localis;"";"Completed User Request for "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
            @Prompt([OK];"Info";"User creation completed. HR department is now informed");
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow])));
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @SetField("Status";90);
               @SetField("Update";"Y");
                @MailSend(localhr:Manager;localis;"";"Completed User Request for "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
            @Prompt([OK];"Info";"User creation completed. HR department is now informed");
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]))
   ))


Ich wäre sehr dankbar, wenn mir jemand helfen könnte. Habe es schon x-mal versucht, bekomme aber dann immer die Meldung, dass eine Klammer fehlt oder so.

Gruss
kibris

cococo69:
Hallo,

wenn ich das nach einem kurzen Blick richtig sehe, werden die Klammern der ersten beiden Ifs nicht geschlossen.

Gruß Armin


--- Zitat von: Kibris am 29.05.06 - 08:02:40 ---Hallo

Ich befasse mich relativ neu mit Notes Formula und habe nun das Problem,
dass ich eine bestehende Action in Formula verändern muss.

Der bestehende Code prüft, ob auf dem Form bei Accounts die 5 Option gewählt wurde, wenn ja ob das Feld "OSDCreated" bereits einen Wert enthält. Das selbe macht der Code auch für die 3. Ich müsste nun die Formel so verändern, dass zusätzlich geprüft wird, ob auch die Option 4 gewählt wurde (und ein entsprechendes Feld prüfen).


@If(@Contains(Accounts;"5");
      @If(OSDCreated="";
         @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @MailSend(localis;"";"";"CS3 Account Created for user "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]));

--->>>  ))  <<<---

@If(@Contains(Accounts;"3");
      @If(VPNCreated="";
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @MailSend(localis;Manager;"";"CS3 Account Created for user "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]));
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @SetField("Status";90);
               @SetField("Update";"Y");
               @MailSend(localhr:Manager;localis;"";"Completed User Request for "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
            @Prompt([OK];"Info";"User creation completed. HR department is now informed");
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow])));
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @SetField("Status";90);
               @SetField("Update";"Y");
               @MailSend(localhr:Manager;localis;"";"Completed User Request for "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
            @Prompt([OK];"Info";"User creation completed. HR department is now informed");
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]))
   ));
      @If(@Contains(Accounts;"3");
      @If(VPNCreated="";
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @MailSend(localis;"";"";"CS3 Account Created for user "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]));
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @SetField("Status";90);
               @SetField("Update";"Y");
               @MailSend(localhr:Manager;localis;"";"Completed User Request for "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
            @Prompt([OK];"Info";"User creation completed. HR department is now informed");
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow])));
      @Do(
               @Prompt([OK];"CS3";"Thank you for creating the CS3 Account");
               @SetField("Status";90);
               @SetField("Update";"Y");
                @MailSend(localhr:Manager;localis;"";"Completed User Request for "+FirstName+" "+Lastname;"Click on the link to review the request";"";[IncludeDoclink]:[Sign]);
            @Prompt([OK];"Info";"User creation completed. HR department is now informed");
               @PostedCommand([FileSave]);
               @PostedCommand([FileCloseWindow]))
   ))


Ich wäre sehr dankbar, wenn mir jemand helfen könnte. Habe es schon x-mal versucht, bekomme aber dann immer die Meldung, dass eine Klammer fehlt oder so.

Gruss
kibris

--- Ende Zitat ---

m3:
@cococo69: Nope, die Klammer macht er bei

--- Code: ---   ));     <<--- HIER
      @If(@Contains(Accounts;"3");

--- Ende Code ---
zu.


Der Fehler steckt IMHO nach dem "@If(@Contains(Accounts;"3");"

In der letzten Zeile die beiden "))" - die linke Klammer gehört zum "@If(@Contains(Accounts;"3");", die rechte zum "@If(@Contains(Accounts;"5");" ganz oben.

Nur die Klammer vom "@If(VPNCreated="";" machst Du nicht wieder zu.

Gelobt sei das neue Feature "Highlight Matching Parents" im Vim 7 - da sieht man sowas auf einen Blick :)

Kibris:
Hallo Armin,

vielen Dank erstmals. Der geschriebene Code sollte aber korrekt sein, so funktioniert er auf jeden Fall momentan.

Ich habe Probleme, den bestehenden Code um eine zusätzliche If-Prüfung zu erweitern..  ???

cococo69:

--- Zitat von: m3 am 29.05.06 - 09:09:31 ---Gelobt sei das neue Feature "Highlight Matching Parents" im Vim 7 - da sieht man sowas auf einen Blick :)

--- Ende Zitat ---

Hallo Martin,

wir haben wohl beide nicht gelesen, dass der aktuelle Code überhaupt kein Problem hat.....  ::)

Was ist das aber für ein Tool von dem Du schreibst, hast Du mir 'ne Quelle mit Infos???

Gruß Armin

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln