How to get a source filename and save it as a field value?

Question

We need to extract the source filename as a field and later parse it in order to retrieve the customer code.
For example, the initial file name could look like this invoice-049001_3.pdf.

049001_3 is a customer code that doesn't exist on an image. We need to retrieve it in order to pass it later as a metadata value.

Answer

It is possible to get a source filename and write a value to a field in the Custom activity, i.e.:


Context.Transaction.Documents[0].GetField("New Field").Value = Context.Transaction.Documents[0].SourceFiles[0].FileName;


The result:

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.