web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Retrieve record attachment and attach it in an email using X++

(0) ShareShare
ReportReport
Posted on by 50

Hi Team,

I'm trying to send an email with an attachment that is taken from certain record using X++, can any one help me with this?

Thanks,

Mohammed 

I have the same question (0)
  • GirishS Profile Picture
    27,827 Moderator on at

    Hi mohamd,

    Please go through this form.

    Common - Common -Document management - Knowledge articles.

    Create a new knowledge article with Type as "File" and try to upload some file.

    After that you can send this attachment as a mail by using "Send" button on the action pane.

    Thanks,

    Girish S.

  • Suggested answer
    Dinaz Profile Picture
    115 on at

    Hi,

    The docuRef and docuValue tables are used to save attachments for a record.

    You can retrieve the filename from the docuRef table.

    docuRef = DocuRef::findTableIdRecId(//pass parameter values);

    mailer.addAttachment(DocumentManagement ::getAttachmentStream(docuRef),docuRef.Name);

  • omesh Profile Picture
    141 on at

    Hi Mohammad,

    Have you written custom code to send email ? or you need to sent it Via any standard process like invoicing ?

  • Suggested answer
    Arunraj Rajasekar Profile Picture
    1,743 on at

    Hi Mohammed,

    This topic has previously been discussed in the forum, and there are numerous references available.

    community.dynamics.com/.../how-to-send-email-with-attachment-x-code

    axtechguy.blogspot.com/.../how-to-send-that-attachments-as-email.html

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 434 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans