Customizing SalesInvoiceHeaderV4 Entity for Missing Fields in OData Integration

I’m currently working on an OData integration where I have a mapping sheet with an entity name and the corresponding fields required for the integration. The issue I’m facing is with the SalesInvoiceHeaderV4 entity, which uses CustInvoiceJour as its data source. The standard SalesInvoiceHeaderV4 entity, however, only contains a few fields, while several important fields are missing, such as:

  • Purchase Order
  • Invoicing Name
  • VAT Number
  • Sales Balance
  • Sum TaxMST
  • Payment Due Date
  • Customer Reference
  • Invoice Round Off

These fields are available in the CustInvoiceJour table, which is used as a data source for the entity. Additionally, fields from TaxTrans and CustInvoiceTrans, as well as the SalesInvoiceLineV4 entity, are needed.

What I’ve Tried:

I attempted to resolve the issue by extending the SalesInvoiceHeaderV4 entity and copying the missing fields. I also extended the staging table and added the new fields to it. However, after building and syncing the project, I encountered an error in the staging table code, stating that there’s an instance method that is inaccessible.

Question:

  • How should I go about customizing the standard SalesInvoiceHeaderV4 entity to include these missing fields?
  • Is there a better way to handle extending the staging table to avoid the instance method error?

Any guidance or best practices for this scenario would be greatly appreciated. Thank you!

Please tell us more about the error. We can’t tell you to avoid the inaccessible method without knowing which inaccessible method you’re using in your code. Also, it’s strange that you’re compiling a staging table, because to add fields, you just need to create, compile and synchronize an entity extension and a staging table extension. There is no need to compile the staging table created by Microsoft, because it doesn’t get changed. Your changes are in those extensions.