Skip to main content
August 27, 2021
Question

Appian Step-by-Step #4 page 13 - testing add vehicle form interface

  • August 27, 2021
  • 2 replies
  • 0 views

Hello,

I am following step by step 4. On page 13, testing the add vehicle form with the data in the tutorial image, I have seen that:

- The first time I click submit the form, the value of "lastUpdated" is updated, but "nextServiceDate" is not updated.


- If I submit the form again, the value of "nextServiceDate" is updated.

Is this behaviour correct or should both fields be updated when I click submit the first time?

The "Submit" button configuration I have is:


      a!buttonWidget(
        label: "Submit",
        value: if(
          isnull(ri!vehicle.lastUpdated),
          "",
          rule!VFM_CalculateNextServiceDate(
            vehicleType: ri!vehicle.category,
            dateUpdated: ri!vehicle.lastUpdated
          )
        ),
        saveInto: {
          ri!vehicle.nextServiceDate,
          a!save(ri!vehicle.lastUpdated,now())
        },
        submit: true,
        style: "PRIMARY"
      )

Thanks for your help.

Best regards.

    2 replies

    gayathris111098
    August 27, 2021

    Since you have directly mapped the button value to the ri!vehicle.nextServiceDate, it will get a value based on button's value condition. I think isnull(ri!vehicle.lastUpdated) this condition is true when you hit submit that's why you see it empty

    September 2, 2021

    Ok. I think it's a bit strange behaviour, but that's what is indicated in the step-by-step exercise.
    Thanks for the answer.
    Regards