Skip to main content
Solved

How to insert/map a file under Files for a Sales Order record through code

  • 12 March 2024
  • 1 reply
  • 111 views

Hi Team,

We are working with Build 23.112.0032 and working on a customization where we have to add an image url ( https://xyz.s3.amazonaws.com/kkltQWuXULPcHQ6TmoMsZkiJOK93x8.png) as File attachment to a Sales Order record through code. We tried to insert this image url under Name field in UploadFile table and later to map this record along with Sales Order NoteID under NoteDoc table but we are facing issue with approach. Can you please suggest the best possible way to achieve this.

 

Thank you in advance!

 

Best answer by DavidEichner

Hi @maneeshau91 

The best way we have found to attach files to records in Acumatica is to make API calls.  As an example, for a client needing service call history records to have multiple file attachments (images, PDF, excel, word, etc.) from a legacy system, we extracted those files from the legacy system into a folder with filename starting with the service order number and service order type.  We then wrote a simple console app in C# that looped through the folder reading the files, logging into the API and uploading the files to attach them to the service orders.  It would be slightly different code to attach to a sales order with the order number and the order type.

Best,

David

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

1 reply

DavidEichner
Captain II
Forum|alt.badge.img+13
  • Captain II
  • 373 replies
  • Answer
  • April 1, 2024

Hi @maneeshau91 

The best way we have found to attach files to records in Acumatica is to make API calls.  As an example, for a client needing service call history records to have multiple file attachments (images, PDF, excel, word, etc.) from a legacy system, we extracted those files from the legacy system into a folder with filename starting with the service order number and service order type.  We then wrote a simple console app in C# that looped through the folder reading the files, logging into the API and uploading the files to attach them to the service orders.  It would be slightly different code to attach to a sales order with the order number and the order type.

Best,

David


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