[AX 2012] An example of "how to attach a document to a record"?

Hi,

i need to find a working example inside AX to attach a file to a record.

Let me explain:

I have a form (a part from the built-in ones…) with various fields about some instruments.

One of these fields should contain a document, a file, attached by the user.

I need to physically store it into the database.

Hope someone could help me finding a working example.

Thank you in advance

ciao

When you create your attached document and save it, it is stored in the database under the table ‘DocueRef’.

The link between DocuRef and the form (table where you have created your record and attached document) is RefRecId.

For example, attach a Note onto a sales order, search for this sales order in the sales table, and copy the RecId of that order…
Open up the docuref table and under the RefRecId column filter on thae sales order RecId.

Hope this makes sense…

Thank you very much, i’m gonna try it. [;)]

I just cannot find the piece of code (i suppose) which links the SalesTable’s record with the DocuRef’s record.

If i click the “add attachment” command in SalesTable form, which piece of code is triggered exactly?

thank you

Look at the classes prefixed with “Docu” - there is a class “DocuAction” - I would look at this.

have a look at the form smmdocuments…

You’ll surely get your answer