Button Configurations

Hi Community Team

I have a query, I need to configure the formlayout buttons. Like Approve and Reject

1. When I click on a Submit button first time, a textfield needs to be populated. It is populated then I click on the submit second time, It Needs to store the textfield field data  into the DB.

But, here I'm facing issue, When I click on Submit Button Firsttime.. tn the Process Model the action is completed.. Unable to add data to the textfield. In DB is showing Empty.

For the textfield I applied ShownWhen: ri!Cdt.Status = true(),

2. When I click on the Cancel button first time, a Textfield needs to be populated. It is populated then I click on the cancel button again, No actions were taken. I want it to complete the action. Needs to store the textfield field data  into the DB.

Similarly, here also For the textfield I applied ShownWhen: ri!Cdt.Status = false(), 

Status is a boolean field in my cdt.

Can You help me out, how to figure it out.

  Discussion posts and replies are publicly visible

Parents Reply
  • Hi ,

    try the below code So, you will know how the submit parameter works in buttonwidget()

    a!localVariables(
      local!map: a!map(name: "", email: "", comment: ""),
      local!submit: false(),
      local!showWhen: true(),
      {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!textField(
                  label: "Name",
                  value: local!map.name,
                  saveInto: local!map.name
                ),
                a!textField(
                  label: "Email",
                  value: local!map.email,
                  saveInto: local!map.email
                )
              },
              showWhen: local!showWhen
            ),
            a!columnLayout(
              contents: {
                a!paragraphField(
                  label: "Comments",
                  value: local!map.comment,
                  saveInto: local!map.comment
                )
              },
              showWhen: not(local!showWhen)
            ),
            a!columnLayout()
          }
        ),
        a!buttonLayout(
          primaryButtons: {
            a!buttonWidget(
              label: if(local!submit, "Approve", "Submit"),
              saveInto: {
                a!save(local!showWhen, false()),
                a!save(local!submit, true())
              },
              submit: local!submit,
              style: "PRIMARY"
            ),
            
          },
          secondaryButtons: {
            a!buttonWidget(
              label: if(local!submit, "Reject", "cancel"),
              saveInto: {
                a!save(local!showWhen, false()),
                a!save(local!submit, true())
              },
              submit: local!submit,
              style: "SECONDARY"
            )
          }
        )
      }
    )

Children
No Data