Search code examples
lotus-noteslotus-domino

Making a field required in a form


How can I mark a field required in a form? With the following formula I can check if the field is null on saving, but it closes the document hence all the information previously entered gets lost, is there a way to prevent that? @If(@IsDocBeingSaved & @IsNull(@ThisValue);@Failure("failed");@Success)


Solution

  • The formula from your question - entered in Input validation - does exactly what you want... It prohibits saving...

    BUT: If you have a button like that:

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

    then the FileCloseWindow will again ask, if you want to save, and if you answer no, the document will be closed and all data will be lost.

    To prohibit this behaviour, one usually uses this code in a "Save & Close"- Button:

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

    Of course the user can always cancel out of editing the document without saving, but then it is his own responsibility.