Solved

Pulling attachment contents via OData

  • 18 March 2021
  • 6 replies
  • 54 views

Userlevel 3
Badge +1

I’m trying to access attachment contents over OData so I can pull Stock Item images into Excel.

 

I tried PX.SM.UploadFileRevision and PX.SM.UploadFileWithData, but the UploadFileRevision.BlobData column doesn’t appear in either a Generic Inquiry or in the OData feed.

 

Does anyone have any ideas on how I can access the raw file attachment contents?

 

Note in these screenshots that there are 5 columns in the Generic Inquiry, but only 4 columns appear in the results:

 

icon

Best answer by Gabriel Michaud 19 March 2021, 13:52

That will definitely not work. There is no infrastructure in Excel that would allow you to have a function that returns an image in a cell or a query that includes an embedded image… I think it’s best to build this report using the Acumatica Report designer.

View original

6 replies

Userlevel 6
Badge +6

It’s not possible through OData -- you have to use the standard REST API to access attachments.

Userlevel 3
Badge +1

Bummer. Any ideas on whether or not it’s possible to use the REST APIs in an Excel connection?

Userlevel 6
Badge +6

Just curious, can you explain what you were intending to do with the file binary data in Excel?

Userlevel 3
Badge +1

I’m building an Excel file for a client that uses Slicers and Pivot Tables. This Excel file is then used by Salespeople to build lists of Stock Items for customers that include availability data and various attributes. They also want to add thumbnail images to the Excel file which are stored as attachments in Acumatica.

Userlevel 6
Badge +6

That will definitely not work. There is no infrastructure in Excel that would allow you to have a function that returns an image in a cell or a query that includes an embedded image… I think it’s best to build this report using the Acumatica Report designer.

Userlevel 3
Badge +1

Thanks Gabriel. I think I was remembering Power View which could handle images in Excel. It was the precursor to Power BI Desktop. I agree, I don’t see a way to do this in regular Excel Pivot Tables.

 

I did try doing this in Power BI Desktop. It kind of works because the client could export to PDF and send the PDF to their customer, but it’s not practical because they need to be able to save a long list of Stock Items as multiple pages, but Power BI Desktop exports everything as one page to PDF.

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 — 2020  Acumatica, Inc. All rights reserved