I'm attempting to create a new data entity to import records into a new table. The table contains a refRecId and refTableId field as it can be related to multiple different records.
I've attempted to link to another record as read only in the data entity using this refTableId and refRecId as the relation but when I attempt to build and sync this I receive errors.
This seems to be down to the fact that although most system fields are automatically pulled onto the data source in the data entity (and the "Dynamic fields" option is greyed out and uneditable), the table Id is not.
I cannot past the full set of errors in, because as is the case with most sql errors like this, it actually produces 50 or so errors. However, it does state "Error Invalid column name 'TABLEID'."
I can't find a standard entity using the refRecId, refTableId combination. Is this just not compatible with data entities?
*This post is locked for comments
Dan,
Just adding to what Ievgen already answered.
You could populate the table name in stead, and in stead of populating the RecId you should probably populate the natural keys for these related records.
I have been building entities on top of a number of relations like that. It's not my idea of great fun.
Hi Dan Griffiths,
I think that you getting this error because TABLEID is x++ concept only. Data Entity creates SQL view under the hood and there is no "TABLEID" in underlying tables, so SQL cannot use field in a view definition that does not exist in SQL.
I don't think that you can use read only data source here at all. You have to populate refRecId and refTableId in x++ code, somewhere in mapEntityTODatasource method by yourself.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156