How to Attach any kind of Document with Purchase Order

BruceBruce Member Posts: 26
hi
How to Attach any kind of Document with Purchase Order with Import ,Export , Delete Functionality

The Attached Document could be Doc File , Xsl File any thing.

For Example , Picture Can be Import , Export , Delete on Company Information Form.

Thanks

Comments

  • sendohsendoh Member Posts: 207
    you can add a blob field.
    Sendoh
    be smart before being a clever.
  • Sandeep_PrajapatiSandeep_Prajapati Member Posts: 151
    Hi Bruce,
    attachment table can be used.

    ImportAttachment,OpenAttachment,ExportAttachment functions.
    IF (AttachmntRec.ImportAttachment(ImportFromFileName,FALSE,TRUE)) THEN 
    BEGIN 
        "Attachment Id" := AttachmntRec."No.";    
        //........
    End;
    
    attachment id (a field in the source table of your form) is ID for your link for the attachment.


    Show
    IF AttachmntRec.GET("Attachment Id") THEN 
       AttachmntRec.OpenAttachment('Attachment  No. -  ' + FORMAT(i),FALSE) 
    





    I hope it helps..... O:)
    Sandeep Prajapati
    Technical Consultant, MS Dynamics NAV
  • garakgarak Member Posts: 3,263
    But note, ff you store the attachment into a BLOB, it makes the DB very big.
    Also if you are on SQL, the NAv client ever reads the Datalength of the BLOB Field. So, sometimes it's better, to store the Docs outside on an seperate network folder. Here in the forum are many topics and solutions about these theme.

    I know, the easiest way is to store the Documents as BLOB in a separete table.

    Regards
    Do you make it right, it works too!
  • djswimdjswim Member Posts: 277
    garak wrote:
    But note, ff you store the attachment into a BLOB, it makes the DB very big.

    Read this five times before you choose to implement the solution above. It will work, but if you're in a high-transaction environment and are attaching a document file to every PO, this can get ugly in a hurry. If you're only going to be doing it in special situations (i.e. orders over a very high threshold of dollar amount) then it could work.

    Personally, I'm of the opinion that aside from your company logo, external files should stay out of the NAV DB.... that space is precious and there are easy ways to attach to something that's in another DB (preferably on another drive or machine)
    "OMG ALL MY DATA IS GONE"
    "Show All..."
    "Oh..."
Sign In or Register to comment.