Skip to main content
New Participant
Aug 20, 2023 4:30 AM UTC
Solved

'ax_addvehicleform' at function a!buttonWidget [line 150]: An error occurred while executing a save: Could not cast from User to Date. Details: CastInvalid

a!buttonWidget(
          label: "Add Vehicle",
          saveInto: {
            a!save(ri!vehicle['recordType!{691ee044-4a47-4798-bd87-7f96ca362496}AX Vehicle.fields.{b54f728c-5e71-4d1f-aad7-661d05c22098}vehicleDateAdded'],
            today()
            ),
            a!save(ri!vehicle['recordType!{691ee044-4a47-4798-bd87-7f96ca362496}AX Vehicle.fields.{b54f728c-5e71-4d1f-aad7-661d05c22098}vehicleDateAdded'],
            loggedInUser()
            )
          },
          submit: true,
          style: "PRIMARY",
          validate: true
        )

I'm working on process models & trying to debug the add vehicle form for adding a new vehicle but after entering the details & I select add vehicle button, I'm getting the above error. What should I do in this case ?

Inspiring
Aug 20, 2023 4:39 AM UTC

Hello Kishore,

I've noticed that you're attempting to store the logged-in username in the date field. To make it work, please make sure to update the field you're indexing in the second save to the appropriate one.

Hope it helps!

2 replies

Inspiring
Aug 20, 2023 4:39 AM UTC

Hello Kishore,

I've noticed that you're attempting to store the logged-in username in the date field. To make it work, please make sure to update the field you're indexing in the second save to the appropriate one.

Hope it helps!

New Participant
Aug 20, 2023 4:50 AM UTC

Yup, it worked! Thanks