Skip to main content
Solved

oData v4 metadata not showing keys for ARInvoice

  • October 26, 2022
  • 2 replies
  • 162 views

KurtBauer
Jr Varsity III
Forum|alt.badge.img

​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

Best answer by Samuel Olivier Lavigueur

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

View original
Did this topic help you find an answer to your question?

2 replies

Samuel Olivier Lavigueur
Acumatica Moderator
Forum|alt.badge.img+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


KurtBauer
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 49 replies
  • November 8, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings