Need to make a field is required for a button which has skipped all the validation including this field.

I have a button which has skipped all rule input field validation on one interface. Right now, I want to get a warning when I click the button without a specific rule input field value. 

I couldn't use validationGroup directly because I have made this specific rule input field is mandatory for one more button on the same interface.

Like the example code below, I want to get a warning "text1 is mandatory" when I click the button1. And text1 and text2 are still mandatory field for button2.

load(
  local!button1,
  local!button2,
  local!text1,
  local!text2,
  a!formLayout(
    firstcolumnContents:{
      a!textfield(
        lable: "text1",
        required: true,
        value: local!text1,
        ssaveInto: local!text1
      )
    },
    secondcolunmContents:{
      a!textfield(
        label: "texx2",
        require: true,
        value: local!text2,
        saveInto: local!text2
      )
    },
    buttons: a!buttonlayout:{
    primaryButton:{
 a!buttonWidegetSubmit(
          label: "button1",
          value: true,
          saveInto: local!button1,
          skipvalidation: true
        ),
        a!buttonWidgetSubmit(
          lable: "button2",
          value: false,
          saveInto: local!button2
        )
      }
    }
  )
)

  Discussion posts and replies are publicly visible

Parents
  • Hi -

    I'm not sure I understand your use case 100%.
    But, your description reminds me of a design decision my team once made when validations started to get very complex.
    Essentially, we did skipvalidation on everything, and then validated the form in process after it was submitted.
    If the form was invalid, we still saved all the data that was entered, but the user could not complete the business process. And, that status was indicated visually to the user.
    They would be able to revisit the form later via a related action on the record.

    This was a specific use case for a business process that included a number of "stage gates" where large blocks of data could be entered and saved in any order, but the user could go to the next stage until the current stage was complete.
    This might, or might not be appropriate for you.
Reply
  • Hi -

    I'm not sure I understand your use case 100%.
    But, your description reminds me of a design decision my team once made when validations started to get very complex.
    Essentially, we did skipvalidation on everything, and then validated the form in process after it was submitted.
    If the form was invalid, we still saved all the data that was entered, but the user could not complete the business process. And, that status was indicated visually to the user.
    They would be able to revisit the form later via a related action on the record.

    This was a specific use case for a business process that included a number of "stage gates" where large blocks of data could be entered and saved in any order, but the user could go to the next stage until the current stage was complete.
    This might, or might not be appropriate for you.
Children
No Data