Validating required fields in a c3 type

#1

When does the validation for the required field in a C3 type happen? Can i assume before making a method call that all the required fields are already populated?

0 Likes

#2

In the db engine, required field validation is done during the upsert process (e.g. create/update/merge or their batch equivalents). That operation will throw an exception if any attempt is made to persist an Obj where the persisted value will be null for a required field. Is this what you were asking?

0 Likes

#3

What about a type that is not persisted?

0 Likes

#4

Are you talking about required fields in an Obj or required arguments in a function call? There are 2 different answers. For a required argument, you can assume that it isn’t null inside of your implementation. For an argument that is an Obj, you can’t assume that the required fields within that Obj are not null (e.g. the upsert case I mentioned performs the validation inside of UpsertTask).

0 Likes