Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create property 'tableRef' on string '{"ablFilter": ... #253

Open
mdossant opened this issue Apr 18, 2019 · 5 comments
Open

Cannot create property 'tableRef' on string '{"ablFilter": ... #253

mdossant opened this issue Apr 18, 2019 · 5 comments
Labels

Comments

@mdossant
Copy link

Not sure if this is related to issue #234. I get the error below:

Cannot create property 'tableRef' on string '{"ablFilter":"SalesRep = "KIK"","orderBy":"Name","top":2,"skip":0}'

It comes from this file / line:
@progress/jsdo-angular/lib/progress.data.angular.js

line 271:

    // tableRef required for multi-table DataSets
    if (filter) {
        filter.tableRef = this._tableRef;
    }

If I comment those 3 lines then it works. This works in version 5 but fails like that in version 6.

@mdossant
Copy link
Author

Again, it's the same source code that works in 5 but fails in 6. Perhaps tableRef is not supported anymore or I need to set it differently? This is how I create the JSDO:

        const jsdo = new progressCore.progress.data.JSDO({
            name: 'SalesReps'
        });

new ngDataSource.DataSource({
jsdo: jsdo,
tableRef: 'ttSalesRep'
});

@joshualan
Copy link
Collaborator

I think we removed that in JSDO 6.0, could you give your use case for it so we can figure out your next steps?

@mdossant
Copy link
Author

Hi Alan,

This is the way I've always used JSDO's by setting tableRef to the business entity's temp-table -- it works in 5.0 in various live apps. I tried not setting it for 6.0 and still got the same error. More importantly, if this has been removed in JSDO 6.0 then what about lines 269 thru 272 below as mentioned before? It seems the JSDO 6 still tries to do something with tableRef.

@progress/jsdo-angular/lib/progress.data.angular.js

// tableRef required for multi-table DataSets
if (filter) {
    filter.tableRef = this._tableRef;
}

Also, I'm not really using multi table dataset. Is there a different way of creating a JSDO without tableRef or am I passing the wrong properties to it? Any help will be greatly appreciated. This is my source code where I create the JSDO and datasource and read data -- again works in 5 not 6:

const progressCore = require('@progress/jsdo-core');
const ngDataSource = require('@progress/jsdo-angular');
...
// calculate/set filter variables based on user input
...
progressCore.progress.data.getSession({
name: 'sportsflex',
serviceURI: serviceURI,
catalogURI: catalogURI,
authenticationModel: progressCore.progress.data.Session.AUTH_TYPE_BASIC,
username: username,
password: password,
}).then(()=>{
const jsdo = new progressCore.progress.data.JSDO({
name: 'SalesReps'
});
const ds = new ngDataSource.DataSource({
jsdo: jsdo,
tableRef: 'ttSalesRep'
});
return ds.read(
filter=JSON.stringify({
ablFilter: ablFilter,
orderBy: orderBy,
top: top,
skip: skip
})
).toPromise();
}).then((response) => {
console.log('number of records retrieved',response.data.length);
complete().setBody(JSON.stringify(response.data)).ok().next();
}).catch((err) => {
console.log('err.message',err.message);
console.log('err.stack',err.stack);
complete(err).runtimeError().next();
});
}

This is my config so you can check the versions on dependencies:

{
"name": "sportsflex",
"version": "1.0.25",
"description": "A kinvey flex jsdo connector for sports app",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Mauricio dos Santos",
"license": "ISC",
"dependencies": {
"@angular/core": "^5.2.1",
"@progress/jsdo-angular": "^6.0.0",
"@progress/jsdo-core": "^6.0.0",
"base-64": "^0.1.0",
"kinvey-flex-sdk": "^3.1.2",
"node-localstorage": "^1.3.1",
"rxjs": "^6.4.0",
"rxjs-compat": "^6.4.0",
"xmlhttprequest": "^1.8.0"
}
}

Thanks,

Mauricio

@zerovian
Copy link
Collaborator

Internal issue number: OCTA-13388

@joshualan
Copy link
Collaborator

@mdossant goal is to be fixing this this week

@edselg edselg added the bug label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants