lotusscriptlotus-formula

display a button after clicking another button


I'm using IBM Domino Designer 9 . So, I have a "Save" button and another "Create Form" button, when the user clicks "Save", the other button will be displayed

Code button "Save" :

@Command([FileSave])

Code button "Create Form" :

Sub Click(Source As Button)

    Dim Stream As NotesStream
    Set Stream=Session.CreateStream
    f=Freefile
    fichier="d:\"+Masque.FieldGetText("nomF")+".dxl"
    Open fichier For Output As #f
    Stream.Open(fichier)

    Call Stream.WriteText(|<database xmlns="http://www.lotus.com/dxl" version="8.5" maintenanceversion="3.0" replicaid="41257FA4002BD8B9" path="CN=PFE/O=AISA!!E_admini.nsf" title="E_administrateur 2015..2016">|)
    Call Stream.WriteText(|<databaseinfo dbid="41257FA4002BD8B9" odsversion="43" diskspace="1142784" percentused="75.5600358422939" numberofdocuments="12">|)
    Call Stream.WriteText(|<datamodified>|)
    Call Stream.WriteText(|<datetime dst="true">|+Now+|</datetime>|)
    Call Stream.WriteText(|</datamodified>|)
    Call Stream.WriteText(|<designmodified>|)
    Call Stream.WriteText(|<datetime dst="true">|+Now+|</datetime>|)
    Call Stream.WriteText(|</designmodified>|)
    Call Stream.WriteText(|</databaseinfo>|)
    Call Stream.WriteText(|<form name="|+Masque.FieldGetText("nomF")+|" nocompose="true" publicaccess="false" designerversion="8.5.3" recalc="true" renderpassthrough="true">|)
%REM    
    Call Stream.WriteText(|<updatedby>|)
    Call Stream.WriteText(|<name>CN=admin/O=AISA</name>|)
    Call Stream.WriteText(|</updatedby>|)
    Call Stream.WriteText(|<wassignedby>|)
    Call Stream.WriteText(|<name>CN=admin/O=AISA</name>|)
    Call Stream.WriteText(|</wassignedby>|)
%END REM
    Call Stream.WriteText(|<globals>|)
...................
    Stream.Close

End Sub

Solution

  • To show and hide buttons in a Notes form, you need to use hide-when formulas.

    You will need to put your two buttons into a table. That way, they will be in separate paragraphs, so they can have their own hide-when formulas. Your Save button's paragraph will have this hide-when formula:

    ! IsNewDoc
    

    The CreateForm button's paragraph will have this hide when formula:

    IsNewDoc
    

    You are also going to have to add a command to your Save button:

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