How to know that document attached or not ?

Hi All ,

As we all know that we can attach the documents of Word , PDF , Images against the masters , journals , documents ( PO / SO ) .

For example i am creating the journal and attached the scanned vendor invoice , that document should be approved by the my manager . when i submit for approval , when manager open the journal , how does he come to know that any attachment is attached or not to the journal ?

Is there any identification available whether the attachment is available or not against the journal ( without clicking the attachment button )

Thanks in advance.


This is the solution I use, it shows if documents are attached to a specific vendor.

On the table you want to attach the doc, add a method as following (I used vendtable in my example, just modify according your requirements):

display smmDocIconNum ShowDoc()
VendTable VendTable;
select VendTable where VendTable.AccountNum == this.AccountNum;

if ((select docuRef //table that stores documents in AX
where docuRef.RefCompanyId == this.DataAreaId &&
docuRef.RefTableId == tablenum(VendTable) &&
docuRef.RefRecId == VendTable.RecId).RecId)
return #RES_NODE_DOC; // returns a book icon if a doc is found for the selected record
return #RES_AM_NEW; // returns a blank page when no doc is found

You have to be very specific on the select, it must return one record.

then on the corresponding form, add a window control on grid lines, set the above method as datasource, it will show if there’s documents attached on the record by showing a book or blank page.

then last step, add a mouseup() or mouseDblClick() method on the icon field you added before with the following code:

int mouseUp(int _x, int _y, int _button, boolean _ctrl, boolean _shift)
int ret;
ret = super(_x, _y, _button, _ctrl, _shift);

if (VendTable && VendTable.RecId && _button == #leftClick)
smmUtility::openSmmDocHandling(VendTable, element);

return ret;

this will open the Docuref form filtered on the document corresponding to your record or blank form if there’ no doc.

mail me if you have more specific questions.

Hope it helps, please verify solution if it solves your problem




I have created a workflow on the smmOpportunityTable form. Normally people do attach documents while they submit this form to Workflow.

How can i apply your solution, which you had mentioned herein? (Becuase there is no grid)


Thomas Philipose


You can try to add the display method on smmOpportunity table, then add a field on your form with the display method you created



one simple way to identify is go to File > Tools > Options, go to Miscellaneous section as shown below:

Whenever you go the journal, you can see the attachment symbol getting enabled which indicates that an attachment exists. If not enabled, no attachment. If you need to identify in detail, you can go for some minor customization as specified by above users.


  • Elmer