: Maurice INZIRILLO
So far I can only ask the user to not affect a Form object variable
to his object form
from this line I am going to guess that you want to design a generic component, where you do not know what the “user” (=a 4D developer) will assign as the variable or expression to the object.
this is an atypical context, which is why I feel there is a difference in temperature between those of us who don’t see the need to know the expression (Form.whatever) by code, because normally we already know what is defined in the property list, and we do not use OBJECT SET DATA SOURCE to change it on the fly, or insist on excessively generic code; we just make sure the expression used in the object method matches the expression defined in the property list, and everything works fine.
in theory, I guess you could call Form convert to dynamic and read the https://doc.4d.com/4Dv17/4D/17.1/Dynamic-Forms.300-4201272.en.html#3692346Data Source>. you will get “A 4D variable, field name, or an arbitrary complex language expression”
but then, if this is a widget, it may not work anyway, even if you did know the expression (Form.whatever) if its feature depended on the On Bound Variable Change form event which only works for variables.
widgets that require this form even should not allow “Form.whatever” as its data source.