empty the form

Hello all,

I am trying to empty the form whenever I press add button it empty the form and take the data to an editable grid like this.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • a!columnLayout(
    contents: {
    a!radioButtonField(
    label: "Document Form",
    labelPosition: "ABOVE",
    choiceLabels: index(rule!ONH_fetch_lookUp(lookUp: "Document Form"),"itemEn",{}),
    choiceValues: index(rule!ONH_fetch_lookUp(lookUp: "Document Form"),"itemId",{}),
    value: if(a!isNullOrEmpty(local!requestDocument.documentForm),null(),local!requestDocument.documentForm),
    saveInto: local!requestDocument.documentForm,
    required: true,
    choiceLayout: "COMPACT",
    validations: {}
    )
    }
    ),

    a!buttonArrayLayout(
    buttons: {
    a!buttonWidget(
    label: "Add",
    iconPosition: "END",
    value: append(ri!requestDocument,local!requestDocument),
    saveInto: {
    ri!requestDocument,
    a!save(local!addNewDocument,null()),
    a!save(local!requestDocument,null())
    },
    style: "NORMAL",
    validate: if(a!isNullOrEmpty(local!requestDocument),"it is not validate",{})




    )
    },
    align: "START"
    )

    This is an example whenever I try to null the date or the dropdown does not work.

  • 0
    Certified Lead Developer
    in reply to abd123

    I think that the issue here is that you put the append into the value for your button. This will not be evaluated at button click. Just use a a!save() as the first line of your saveInto.

    Regarding that error message you mentioned, it would help a lot to post it.

    And next time, 

  • 0
    Certified Senior Developer
    in reply to abd123

    Hello ,

    Append will not help you perform your desired action in the Value parameter. Try using in saveInto parameter using a!save().

    {
     a!save(
     ri!requestDocument,
     append(ri!requestDocument,local!requestDocument)
     ),
     a!save(
     local!requestDocument,
     null()
     ),
     a!save(
     local!addNewDocument,
     null()
     )
     }