Skip to main content

​We are trying to use the new oData v4 to integrate with an Dataself, but when trying to pull metadata there are no keys for the ARInvoice table, as shown below in the screenshot.  We can make direct calls to the table using queries similar to the following and get results.  Is there a reason there aren’t any keys listed in metadata for ARInvoice?

MetaData showing ARRegister, ARInvoice & SOInvoice


All of the following requests return results with both the DocType and RefNbr

Thanks,

Kurt

This is due to the way the metadata is define in the “Common Schema Definition Language (CSDL) (OData Version 3.0)”

https://www.odata.org/documentation/odata-version-3-0/common-schema-definition-language-csdl/

in the point “6.1.2 The edm:BaseType Attribute”

it says the following:

An entity type that provides a value for the base type attribute MUST NOT declare a key with the edm:Key element.

An entity type inherits the key as well as structural and navigation properties declared on the entity type’s base type.

 

so in this case in order to get the keys you probably have to join the entity with its BaseType entity to get its keys


Thanks for the update.  I’m still unsure on how we can expose ARInvoice using oDatav4 to be consumed by DataSelf.  If we create a GI wouldn’t that still have to query the database which is where we are running into performance issues?

Thanks

Kurt


Reply