Take the 2-minute tour ×

how to get a filename attached to a record in AX 2012... e.g., I have some table named table1 in which I have attached a file with each record.

Now, i want to write a job to fetch the name of files attached to a particular record in a table.

I got it working as

static void CheckAttacheddocu(Args _args)
   Dev_Attachment objAttachment;
    DocuRef obj_docuRef;
   select  objAttachment
      where objAttachment.AttachmentId == "001";

    select obj_docuRef
        where obj_docuRef.RefRecId == objAttachment.RecId;
share|improve this question
How did you attach the files? –  Jan B. Kjeldsen Dec 26 '12 at 6:47
I have attached files using standard document management in AX 2012. i.e, using document handling form. –  Mohd Saddaf khan Dec 26 '12 at 7:18

1 Answer 1

up vote 2 down vote accepted

Consider using the path on the DocuRef table.

select obj_docuRef
    where obj_docuRef.RefRecId == objAttachment.RecId;
share|improve this answer

Your Answer


