Save and Close schließt Dokument + Datenbank + Workspace

  • Hallo zusammen,


    ich verstehe glaube ich gerade die Save and Close Funktion ala @Command([FileSave]));@Command([FileCloseWindow]); nicht.


    Wir haben einen Save and Close Button. Hinter diesem Button liegt die folgende Aktion.


    @If(
    NewSystemname = "";
    result1 := @Prompt([YesNo]; "Save Error" ; "Document cannot be created because the systemname field is empty! Would you like to close the document without saving?");
    SystemAdress = "";
    result2 := @Prompt([YesNo]; "Save Error" ; "The Document cannot be saved. Please provide the Application Adress! Would you like to close the document without saving?");
    ApplicationVendor = "";
    result3 := @Prompt([YesNo]; "Save Error" ; "Please provide the name of the application vendor for this application. Would you like to close the document without saving?");
    ApplicationVendorWebsite = "";
    result4 := @Prompt([YesNo]; "Save Error" ; "Please provide the website the application vendor for this application. Would you like to close the document without saving?");
    SystemGroups = "";
    result5 := @Prompt([YesNo]; "Save Error" ; "Please provide some usergroups which can access the application. Would you like to close the document without saving?");


    @Command([FileSave]));
    @Command([FileCloseWindow]);


    @If(result1 = 1;
    @SetField("SaveOptions";0) &
    @Command([CloseWindow]);
    result2 = 1;
    @SetField("SaveOptions";0) &
    @Command([FileCloseWindow]);
    result3 = 1;
    @SetField("SaveOptions";0) &
    @Command([FileCloseWindow]);
    "");
    result4 = 1;
    @SetField("SaveOptions";0) &
    @Command([FileCloseWindow]);
    result5 = 1;
    @SetField("SaveOptions";0) &
    @Command([FileCloseWindow]);


    Wenn ich nun auf diesen Button klicke und alles brav ausgefüllt worden ist, dann schließt Notes zwar das Dokument, schließt jedoch auch die Datenbank, in welcher das Dokument ist und den Workspace gleich noch mit dazu.


    Habe ich hier irgendwo einen Denkfehler? Achso, wir setzen den 8.5.3 Clienten ein, falls das eine Bedeutung hat.


    Danke und Grüße


    Der Lord

  • Hallo zusammen,


    habe das Problem bereits gelöst.


    Der neue Code sieht nun so aus:


    @If(
    NewSystemname = "";
    result1 := @Prompt([YesNo]; "Save Error" ; "Document cannot be created because the systemname field is empty! Would you like to close the document without saving?");
    SystemAdress = "";
    result2 := @Prompt([YesNo]; "Save Error" ; "The Document cannot be saved. Please provide the Application Adress! Would you like to close the document without saving?");
    ApplicationVendor = "";
    result3 := @Prompt([YesNo]; "Save Error" ; "Please provide the name of the application vendor for this application. Would you like to close the document without saving?");
    ApplicationVendorWebsite = "";
    result4 := @Prompt([YesNo]; "Save Error" ; "Please provide the website the application vendor for this application. Would you like to close the document without saving?");
    SystemGroups = "";
    result5 := @Prompt([YesNo]; "Save Error" ; "Please provide some usergroups which can access the application. Would you like to close the document without saving?");


    @Command([FileSave]));


    @If(result1 = 1;
    @SetField("SaveOptions";0);
    result2 = 1;
    @SetField("SaveOptions";0);
    result3 = 1;
    @SetField("SaveOptions";0);
    "");
    result4 = 1;
    @SetField("SaveOptions";0);
    result5 = 1;
    @SetField("SaveOptions";0);
    @Command([FileCloseWindow])


    Danke und Grüße


    Der Lord

  • Hi,


    Versteh ich dennoch nicht ganz Deinen Code.


    Du fragts bei bestimmeten Feldern ab, ob eteas eingetragen wuirde. Wenn Nein fragst Du den Benutzer, ob er das Dokument ohne speichern schliessen will.


    Dann SPEICHERST Du das Dokument, setzt dann die SaveOptions auf 0 und schliesst das Dokument. Aus meiner Sicht kann der Benutzer antworten wass er will, gespeichert wird in jedem Fall.
    btw. Ist SaveOptions nicht ein Textfeld?



    Andreas

    • Offizieller Beitrag

    richtig - SaveOptions muss ein Textfeld sein

    Rein logisches Denken verschafft uns keine Erkenntnis über die wirkliche Welt.
    Alle Erkenntnis der Wirklichkeit beginnt mit der Erfahrung und endet mit ihr.
    Alle Aussagen, zu denen man auf rein logischen Wegen kommt, sind, was die Realität angeht, vollkommen leer.
    Albert Einstein

  • Da hab ich doch gleich noch ein Frage zum Code.


    Wo steht denn der Code?

    Wie jetzt?? Der Code steht doch oben? :)
    Aber vielleicht hilft diese Passage im ersten postin:


    Wir haben einen Save and Close Button. Hinter diesem Button liegt die folgende Aktion.

  • Zitat

    Wie jetzt?? Der Code steht doch oben? :)
    Aber vielleicht hilft diese Passage im ersten postin:


    Wir haben einen Save and Close Button. Hinter diesem Button liegt die folgende Aktion.


    Wer lesen kann ist ...


    Aber jetzt faellt mir auch wieder ein, warum ich die Frage gestellt habe.


    Wenn mit dem Button das Dokument gespeichert werden soll, und der Benutzer bei den geschilderten Faellen die Wahl haben soll, was passiert, wenn ich "STRG + S" bestaetige oder das Symbol zum Speichern in der Symbolleiste, oder das
    Dokument ueber das "System-Menue" (das x) schliesse und die anschliessende Frage ob speichern oder nicht mit Ja beantworte.



    Andreas