Get full physical path on attachment AX 2012 (DocuRef) example code

 select firstOnly  DocuRef
 order by docuRef.RecId DESC
    where
        DocuRef.RefRecId     == _record.RecId
    &&  docuRef.RefTableId   == _record.TableId
    &&  docuRef.RefCompanyId == curext();

    filename            =   DocuRef.completeFilename();