Mass pull down of attachments?

I have a request to pull all of the documents from a certain suppliers invoices for a year. I can find the documents in the xFileRef table, which effectively gives me a list. Does anyone know how I can use that list to pull a mass download of those documents from ECM?

Is not Create Date on the properties? Or do they not match the apply dates?

1 Like

Non-programmatic answer is that if you can find them all in a search, then you can select them, and use the “Share → Save A Copy” on the Actions menu to download as a Zip file.

3 Likes

There is also a DMS Tool that comes with ECM, and I think it could be used for this sort of thing, but I’ve only ever heard it being used for mass conversions between content systems.

So these attachments don’t have any meta data in them in ECM. They are attached from within Epicor, so I can’t search in ECM for them, because I don’t have the vendor or invoice number or invoice dates. I can get that from Epicor, using xfileattach and xfileref, but that just gives me a list of file names, which I could use to find in ECM, but it’s like 500 or so attachments. They are complaining about looking these up one at a time in Epicor and grabbing that attachment, so doing that in ECM one at a time isn’t much better.

Do those limitations make sense?

1 Like

@Banderson I’ve used the keyword to lookup REST fields. Since the documents could be sent through a workflow to lookup more field data this would fill in the data for future usage /searches. Then you will search for fields and filter by Content type and/or Tablename in a saved search.

2 Likes

@Banderson, like @swilliasc111 mentioned about workflows, ALL documents we intake into ECM go through a basic metadata collection workflow so that there is enough metadata in ECM to do what you want. We also do a bit of folder storage control for certain transaction types. You may want to consider doing this going forward. I can give you of mine if you want.

As for an immediate solution…

I think you should be able to get from XFileAttach/XFileRef over to the DocumentID in your ECM database. Somewhere in the Document tables should be the physical file name the ECM stored it as. Maybe a Powershell script using the query output could copy all of those files to a directory for you.

Also, we posted here a while back some things about generating the URL for a Document, maybe your team can whip up a HHTP File transfer script to do the same.

We’re cloud ( :cry: ) so I don’t have direct access to the database.

This was what I was maybe thinking about. I can probably do a dashboard that displays the list then a publish subscribe. I just need to know if that’s good enough for what they are trying to do with the docs.

While it doesn’t help with the past documents, adding metadata tags to the Document Types moving forward would be recommended.

@swilliasc111 hit on a strong note about the keywords as those will come over naturally based on the key fields of the table to which the attachment was added in Epicor.

As for gathering these in ECM, each Document Type created in Epicor that uses the Attachment Type for ECM will automatically have a Content Type and Security Class created for them in ECM. This will be in the format of “DocID_CompanyID” which could be a method to pull up all of the records you’re after by Content Type. Using the search fields you could limit this to a date range you specify.

1 Like

Ice.BO.XFileRefSvc - In this REST call I’ve used a Title field from ECM to lookup the Attachment SysRowID / XFileRefNum. So even if the Metadata is sparce, you can lookup attachment that exists, and since I have used this in the past to delete attachment / then use the Create attachment datalink, you can delete/create attachments and pull metadata at the same time. This is definitely an interesting way to leverage ECM, but the easiest method is to have the Metadata the first time around.

1 Like