"The property xx is undefined for the type JSFoundset"?

Hi, I have this pseudo-code:

var x = tableA_to_tableB.tableB_to_tableC.field

I receive this warning:

The property tableB_to_tableC is undefined for the type JSFoundset<tableA_to_tableB>

Of course, relations tableA_to_tableB and tableB_to_tableC are defined, and code works fine, but can I supress the warning?

Does code completion on “tableA_to_tableB.” offer “tableB_to_tableC” as an option?

If not, something is amiss in your code/design, I think.

If it does yield “tableB_to_tableC”, then please file a case in our support system with a sample, because then something is amiss and you shouldn’t be getting the warning in the first place.

Paul

You are right, “tableB_to_tableC” is un reachable from “tableA_to_tableB” :?
I’ve modified my code and th warning desappeared.

Now, I have this code:

var fs;
if(someOption == 1) {
    fs = databaseManager.getFoundSet(serverA, table1);
} else {
    fs = databaseManager.getFoundSet(serverA, table2);
}
[...]
fs.field1 = 10; //Warning: the property field1 is undefined for the type JSFoundset

How can get rid of that warning? I can’t define the datasource of fs, because it depends on someOption variable and field1 is only a column of table1

log-out:
You are right, “tableB_to_tableC” is un reachable from “tableA_to_tableB” :?
I’ve modified my code and th warning desappeared.

Now, I have this code:

var fs;

if(someOption == 1) {
fs = databaseManager.getFoundSet(serverA, table1);
} else {
fs = databaseManager.getFoundSet(serverA, table2);
}
[…]
fs.field1 = 10; //Warning: the property field1 is undefined for the type JSFoundset




How can get rid of that warning? I can't define the datasource of **fs**, because it depends on **someOption** variable and **field1** is only a column of table1

Try using ```
fs[‘field1’]=10;


Of course field1 must exist in table1 and table2 otherwise you will have an error. That is the purpose of the warning while writing code that you do not have typos in your variables, etc.

If field1 will not exist in both tables you must take care of that and do something like:

if(someOption==1){
fs[‘field1’]=10;
}


This way you will not get the warning in the editor and of course you will not have the error at running time.

jasantana:
Try using ```
fs[‘field1’]=10;

Thanks, with that syntax I get rid of the warning