Hello Experts,
I have customers list page and there is button called "Add customer". After clicking add customer below popup will open.
Only name is mandatory in form. When I am saving it, it is giving error. But If I filled all fields data, it is saving successfully.
What should I do?
Add customer action is below:
customer operation wrapper is below:
Hi Nayana,
Please go through below post. seems like same issue
https://www.outsystems.com/forums/discussion/44366/object-cannot-be-cast-from-dbnull-to-other-types/
Thanks
CV
@Chandra Vikas I didn't find my answer in above link. What exactly i need to check?
Hi Nayana
assign zero to the numeric fields by default. From what I understood that may be the cause for the error that you are getting.
Regards
Hi Nayana.
Can you please share the structure of the database table and also the debug values when it reaches the CreatetblCustomer?
The error suggests that your entity contains fields expecting non-null values, but null values are being sent. Please review your entity to identify any mandatory fields that might not be receiving data. Additionally, consider hidden attributes not displayed on your form (e.g., CreatedBy, CreatedOn) that are typically set on the server before saving to the database.
My table structure is below:
Can you please also share the debug values when it reaches the CreatetblCustomer?
Is it possible to share the OML as well?
the last field isActive its mandatory, my guess is here, maybe you could assign a default value on that field.
this field we have added recently. Earlier also we were facing same error
Nayana,
try giving all the text fields a default value as you've done with the numeric fields, I think that will bypass the problem.
What I mean is the fields that appear on the form, would try first with those.