Get error using View data type - CastError: Cast to ObjectId failed for value "hAOtkP" (type string) at path "view" because of "BSONError"

I have an object class with a property of data type “View”. When I try to persist an object I get this error: CastError: Cast to ObjectId failed for value “hAOtkP” (type string) at path “view” because of “BSONError”

The runtime data source, which the form is bound to, seems to accept the value.

Any ideas?

Hi, welcome to the Community! Thank you for posting your question.

It is not intended to be able to use Object Classes of data type View, this is in fact being removed in an upcoming version release of Create. It is not intended to be able to save metadata in the form of a View, which leads to very tightly-bound link between data and the UI model which will not work when duplicating an app, for example.

If logic against a datatype “View” is required, it is recommended to do this at the app-level by using conditions, visibility conditions or something similar.

Thanks
Rhys
Appfarm

Thank you, Rhys. Then I will go down another path.

Best,
Eirik.