Skip to main content
Answer

How to link uploaded files to inventory items in a generic inquiry

  • May 4, 2023
  • 1 reply
  • 433 views

Forum|alt.badge.img

I am trying to get a file id associated with an image for a stock item. I found this information on stack overflow that states that you can link these tables for the entity table and the UploadFile table through the NoteID field. However, I am not having success with this. I think this may be because Stock Items don’t have an associated note id and those are only for screens with associated documents like a sales order, but I’m not sure. I am linking these tables in this way:

I’ve been able to have partial success with this, but it’s very slow and only successful for around 60% of the results. Does anyone know if there is a field that can link between PX.Objects.IN.InventoryItem and PX.SM.UploadFile?

Best answer by aaghaei

You will need to join Inventory with NoteDoc on Inventory.NoteID = NoteDoc.NoteID and NoteDoc with UploadFile on NoteDoc.FileID = UploadFile.FileID. 
The revisions of Files are kept in UploadFileRevision table and can be joins on FileID to UploadFile

1 reply

aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • Answer
  • May 5, 2023

You will need to join Inventory with NoteDoc on Inventory.NoteID = NoteDoc.NoteID and NoteDoc with UploadFile on NoteDoc.FileID = UploadFile.FileID. 
The revisions of Files are kept in UploadFileRevision table and can be joins on FileID to UploadFile