Adding Attachments to customer part cross reference form

Does anyone know how I can add attachments to the customer part cross reference screen or any form in general? Methods or BOs needed or sample code is very appreciated!

Good morning everyone, I’m still trying to figure this out lol.

Hi Alan,

For automatic attachment, we run it on the other side. Powershell : If files copied to “x” spot with “x” filename convention, run DMT to upload the hyperlinks and associated data, and then also move the files to our central repository.

Am I right to assume you are looking for something more internal to Epicor?

Nancy

1 Like

It depends a bit which bit of the attachment process you’re trying to do.

Any object in Epicor which natively can take attachments generally has a set of methods in the adapter that handle it - that’s the side of allowing attachments to be created by the user. For example, QuoteAdapter has GetNewQuoteHedAttch(int quotenum). You then add a row to the …Attch table in the dataset and populate it as necessary.

The Epicor attachment tables seem to be fairly easy-going, and it isn’t much harder to create attachments for any BOs that don’t have such methods, either, for example by means of an uBAQ.

Either way, you can use standard C# to move files to where they need to be as necessary. CompanyAdapter lets you get to your current company, and the Company table has an “AttachNetworkRoot” field for the default file location. If you’re using this kind of code then we can assume you can deal with permissions etc.

If you want to SHOW attachments on a form where they exist against the object but aren’t shown, then the easiest way is a grid bound to a BAQ based on the XFile tables. It’s also simple standard C# to allow attachments to be opened from that by double-click or whatever you decide. When we do this, we often make the attachment process itself more intuitive by putting some code on the grid to allow attachment by dragging and dropping onto it.

3 Likes