When I use skipvalidation inside a!buttonWidgeSubmit, why did I still get warning for the field which is required in the form?

I want to use skipvalidation to avoid all the required field for one of the buttons. But with the test code, it didn't work. Can someone help me out. I could just find few document and reference about skipValidation. The current version I use is 16.1.

load(
local!button1,
local!button2,
local!button3,
local!text1,
local!text2,
local!text3,
a!formLayout(
label: "test",
firstColumnContents: {
with(
a!sectionLayout(
firstColumnContents: {
a!dropdownField(
label: "testabc",
required: true,
placeholderLabel: "choose",
choiceLabels: {"a", "b", "c"},
choiceValues: {"a", "b", "c"},
value: local!text3,
saveInto: local!text3,
requiredMessage: "have to select a abc"
),
a!textField(
label: "test1",
required: true,
value: local!text1,
saveInto: local!text1,
validations: if(
len(
local!text1
) > 10,
"right",
"wrong"
)
),
a!textField(
label: "test2",
required: true,
value: local!text2,
saveInto: local!text2
)
}
))
},
buttons: a!buttonLayout(
primaryButtons: {
a!buttonWidgetSubmit(
label: "save1",
value: local!button1,
saveInto: local!button1,
skipValidation: true
),
a!buttonWidgetSubmit(
label: "save2",
value: local!button2,
saveInto: local!button2
)
},
secondaryButtons: a!buttonWidgetSubmit(
label: "close",
style: "DESTRUCTIVE",
skipValidation: true,
confirmMessage: null,
value: local!button3,
saveInto: local!button3
)
)
)
)

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Hi ,

    The code looks good. Have you tested this in Tasks/Actions in Tempo/Sites or only in interface Design View?

    If you haven't tried it in Tempo/Sites view, give a try. I remember like in Interface Design View you will see the validation message for SkipValidaion but it works well in Tempo/Sites view.

  • Thats right the code looks good one way you can see the code is actually working is by setting all the values of the buttons to the same rule input

    If the value of the ri!button changes it means it was submitted of the value remains the same maybe something prevented the submit to happen like the validations you have.

    I personally don't recommend setting the values of the buttons to a local variable as you have in your code. since you are taking action to get out of that screen its better to set every button to the same variable.

    like this
    primaryButtons: {
    a!buttonWidgetSubmit(
    label: "save1",
    value: "save1", /*this can be better in a constant*/
    saveInto: ri!button,
    skipValidation: true
    ),
    a!buttonWidgetSubmit(
    label: "save2",
    value: "save2",/*this can be better in a constant*/
    saveInto: ri!button
    )
    },
    secondaryButtons: a!buttonWidgetSubmit(
    label: "close",
    style: "DESTRUCTIVE",
    skipValidation: true,
    confirmMessage: null,
    value: "close", /*this can be better in a constant*/
    saveInto: ri!button
    )
    Jose