Skip to main content
August 20, 2023
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

  • August 20, 2023
  • 2 replies
  • 0 views

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 ?

Best answer by mathurambm639546

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

August 20, 2023

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!

August 20, 2023

Yup, it worked! Thanks