Solved

oData v4 metadata not showing keys for ARInvoice

  • 26 October 2022
  • 2 replies
  • 136 views

Userlevel 4
Badge

​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

icon

Best answer by Samuel Olivier Lavigueur 28 October 2022, 21:30

View original

2 replies

Userlevel 3
Badge +2

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

Userlevel 4
Badge

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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved