Incorrect Child Relation Error

Servoy 7.4.6

After upgrading to 7.4.6, our customers started getting the following error message:

An incorrect child relation (census_to_census_summary) was accessed through a foundset (or a record of foundset) with datasource ‘null’. The accessed relation actually has ‘db:/arm_data/billing_census’ as primary datasource. It will resolve for legacy reasons but please fix it as it is error prone.

The code that failed is:

        var fs = databaseManager.getFoundSet( 'arm_data', 'billing_census' ).duplicateFoundSet()
        
        fs.loadRecords( census_to_census_summary )	// FAILED ON THIS LINE OF CODE

The table ‘billing_census’ has lots of data, so I do not understand the ‘null’ ascpect of the error message. The code had been working for many years. I am at a loss how to fix this. The ‘billing_census’ table is related to the ‘billing_summary’ table using a PK and FK. What is the proper way to code this relationship?

Thanks!

Hi Kim,

This method is in a form context?
Is this form using the same datasource as the left side of the census_to_census_summary relation?

Hi, Robert. I hope you are doing well.

The method is on a print selector form having no datasource, just form variables. Once the print parameters are selected by the user, the method creates an appropriate foundset that is passed to a Jasper Report.

If I examine the foundset prior to execution of the fs.loadRecords( census_to_census_summary ) code, the foundset has data.

This is a result of case SVY-9196. It’s just a message that shouldn’t interfere with how the solution runs.

It probably works for you because the variables you have defined match the primary dataproviders listed in the relation.
This is (I think) in your case intended but in other cases it might work by mistake and lead to errors. You can change that into a global relation instead.

So now you have a table-based relation that actually works on form variables. The purpose of that case was to make that kind of unexpected situation obvious so that it can be clarified.

Now an unrelated comment (no relation to the situation you have but other ppl. searching for this error message might bump into it): there is one known case where where this message can appear incorrectly - if you have set on a field of a form a related dataprovider going through multiple relations, like “a_to_b.b_to_c.someColumn”. That is already fixed for next release.

Andrei Costescu:
It probably works for you because the variables you have defined match the primary dataproviders listed in the relation.

So now you have a table-based relation that actually works on form variables.

Interesting. I didn’t know you could do that.
So effectively you have a global relation but instead based on a form variable (okay…technically not a true global relation then).

Thank you both for your input. And, please accept my apologies for the late reply.

It’s just a message that shouldn’t interfere with how the solution runs.

Perhaps, but it sure freaks out our users who are not necessarily computer savvy.

Regardless, I wanted to point out that stopping/restarting Servoy server seems to have cleared the problem as it has not reappeared in more than a week’s time.

there is still some error on the line here, I think.

kwpsd is mentioning that users really see this error, popping up, right?
and Andrei, says it’s just an error in the error pane inside Eclipse, right?

It shouldn’t generate any popup - just a message in the app. server logs and developer console view should appear.
Btw, I made that be a WARN message (7.4.7) in the logs instead - as more ppl. were scared by it :) even when it was correct.

Your users didn’t get popups right kwpsd?

It’s been a while…I believe the error message came from the customer’s log file. My apologies for the confusion in my original post.