Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Suggested answer

Copy attachment from Quotation to Sales Order

Posted on by

Hi all,

I am looking for a way to copy the file I have attached to a quotation line (image 1) and/or a general attachment (image 2) to the Sales Order whenever I confirm the Quotation. I am using AX 2012 R2. I searched through the parameters but I can't get it working... I found that the option is available in the R3 release. 

I made a quotation, attached a document and now the blue "document icon" appears on the quotation line (see attached image 1). When I confirm and promote the Quotation to Sales Order, the attachment is lost however. 

3750.2.png

Thank you for your help,

Best regards,

Luuk Schulte

Categories:
  • Suggested answer
    Roger M. Profile Picture
    Roger M. 302 on at
    RE: Copy attachment from Quotation to Sales Order

    Great, As an addition to your post it could be fine add the same code in SalesQuotationEditLinesForm_Sales_Confir .createSalesLines. After salesLine.Create(....) add this: Docu::copy(salesQuotationLineUpdate, salesLine);

  • Suggested answer
    Loz Saunders Profile Picture
    Loz Saunders 51 on at
    RE: Copy attachment from Quotation to Sales Order

    I know this an old thread but in case others are looking for an answer, here's a simple solution. In the SalesQuotationEditLinesForm_Sales_Confir class, add the following code to the updateNow method, after the line this.writeJournal(); around line 67:

    Docu::copy(salesQuotationTable, salesTableCreated);

    The attachment from the quotation will now be copied to the sales order whenever a quotation is confirmed.

  • sohaibcheema Profile Picture
    sohaibcheema 46,592 User Group Leader on at
    RE: Copy attachment from Quotation to Sales Order

    Jackie,

    go on your thread to find answer

  • Manikanda Gopal Profile Picture
    Manikanda Gopal 250 on at
    RE: Copy attachment from Quotation to Sales Order

    Hi ,

    I am too facing same problem.. Please take a look at this question " community.dynamics.com/.../166810;

  • Suggested answer
    Rachit Profile Picture
    Rachit 4,011 User Group Leader on at
    RE: Copy attachment from Quotation to Sales Order

    In addition to good description from Sohaib, you can also refer to standard AX function, \Classes\smmDocuments\fileCopy() to get an idea. You might not need to use the complete code but can extract the code relevant to you.

  • Suggested answer
    sohaibcheema Profile Picture
    sohaibcheema 46,592 User Group Leader on at
    RE: Copy attachment from Quotation to Sales Order

    All attachments have reference inside DocuRef (Table). you need to do following

    Simply Create a New record in DocuRef (Table) with following

    1. Reference of new table and record (reftableid and refrecid) in your case it will be of sales lines
    2. take path and name of file from record of DocuRef which exist for SalesQuotataionLine

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,513 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,862 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans