Skip to main content
julienc
August 29, 2024
Question

Form validation not launched when interface called from record view

  • August 29, 2024
  • 5 replies
  • 0 views

It is a FormLayout with submit button, that works as a standalone: validation before the startprocess is fired.

However, if I make it an interface called from a record view, it stops working: the process starts without the validation being done (basic "required" info).

Here is the simplified code for the form:

    a!formLayout(
      contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!textField(
                    label: "Numéro article",
                    labelPosition: "ADJACENT",
                    value: ri!record['recordType!{b3cc31cc-1595-401f-b13c-16b953dd1f5b}ED Projet.fields.{b0296e3d-29b7-42e8-acd8-a99e9fd26649}budgetPrevisionnel'],
                    saveInto: ri!record['recordType!{b3cc31cc-1595-401f-b13c-16b953dd1f5b}ED Projet.fields.{b0296e3d-29b7-42e8-acd8-a99e9fd26649}budgetPrevisionnel'],
                    required: true
                  ),
                },
              ),
            },
          ),
      },
      buttons: a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "do",
            saveInto: {
              a!startProcess(
                processModel: cons!ED_PM_PROJET_CREATE,
                processParameters: {
                  cancel: false, 
                  projet: ri!record, 
                },
              )
            },
            submit: true,
            validate: true
          )
        },
      )
    )

The interface has good behaviour (validation fires) as a standalone when I test it,

/resized-image/__size/640x480/__key/communityserver-discussions-components-files/14/2024_2D00_08_2D00_29-15_5F00_26_5F00_33_2D00_ED_5F00_CreateCommande2-_2220_-Appian-Interface-Designer-_1420_-Mozilla-Firefox.png


but when I call it from the record view, it doesn't work anymore.
/resized-image/__size/640x480/__key/communityserver-discussions-components-files/14/2024_2D00_08_2D00_29-15_5F00_27_5F00_40_2D00_Projets-_2D00_-EASYDOC-_2D00_-vMASTER_23002300_APPLI_5F00_VERSION_23002300_-_1420_-Mozilla-Firefox.png

How could I make it work as I thought it would? I really need this button to start manually the process, because I want to redirect to another record, and I don't know if Appian will  let me do this with normal actions.

Thanks!

5 replies

konduruc733182
August 29, 2024

Have you tried the disable button option when the value is null or blank?

julienc
juliencAuthor
August 29, 2024

This would be an alternate solution, of course.

stefanhelzle0001
August 29, 2024

Using a!startProcess in a button that also has submit=true makes not much sense for me. What do you try to achieve with this?

julienc
juliencAuthor
August 29, 2024

I try to have validation on the form fields.

In fact, removing the submit=true solves the issue, but still, it puzzles me that it works in unit test, but fails in the record view context.

Thanks a lot!

julienc
juliencAuthor
August 29, 2024

In fact, I have the submit=true for the case it is called as a start form. But I can make the value depend on how I call the interface.