In trying to convert from v2.2.7 to 3.1.5 I’m getting the following error…
Cannot convert null to an object.
Callstack:
SOSTRS_Production_Facility_Detail.showDetails
SOSTRS_Production_Facility_Detail.onShow
TypeError: Cannot convert null to an object. (showDetails; line 11)
SOSTRS_Production_Facility_Detail.showDetails
SOSTRS_Production_Facility_Detail.onShow
When I look at that line of code in the showDetails method I see this…
I have checked the relations and they work perfectly elsewhere and are based on a single 10 digit text field in each table. The fields the relations refer to, lquote and lvoid, are both integers.
Everything replaces properly from the Debuggers Navigator Tree.
Is there some new syntax in 3.0 that’s not evident?
As Patrick says (and I…) first do a databaseManager.hasRecords(relation) check.
When there are no records on either side this will be captured by it.
Even if you think the relation can never be wrong you should still check.
I am sure the relation works great. But you are asking that relation (which is actually a foundset) for a certain property (a field value). And if the foundset is null, then you ask null.property. Properties belong to objects, so you get “cannot convert null to an object”.