Question

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;
    info(obj_docuRef.Name);
}
Was it helpful?

Solution

Consider using the path on the DocuRef table.

select obj_docuRef
    where obj_docuRef.RefRecId == objAttachment.RecId;
info(obj_docuRef.path());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top