Options

Attaching text files with the customer record

jksjks Member Posts: 277
Hi all,

How can i attach the multiple text files to a custome record?
I want to store text files of a particulart customer in the table (along with the customer record).

Which data type should i choose so that i can store multiple text files?
(i am generating the text file when user click on one button. so at a time one file will be generated)

Please help.

Comments

  • Options
    krikikriki Member, Moderator Posts: 9,090
    Create a new table, connected to the customer.
    Primary key could be "Customer No.","Line No.". With fields
    "File Name" : the name of your text-file
    "The File": BLOB

    So each text-file will be 1 record in this table. The file itself will be put in the BLOB-field and the name of the file you can save in the field "File Name".
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    jksjks Member Posts: 277
    Hi,
    Can't we store all the files in one blob field?Because i have so many licence files for each customer.

    Please help.
  • Options
    krikikriki Member, Moderator Posts: 9,090
    It is possible, but you have to keep track of them yourself. For the BLOB, it is only 1 file.
    So it would be better to create different BLOB-fields in the customer-record.
    But this has the negative that you have to know the maximum filenumber a customer can have. Also YOU have to write a lot more code to maintain the BLOB-fields.
    So the easiest is the extra table with an infinite number of files in it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    WaldoWaldo Member Posts: 3,412
    Just use the Attachment table.

    Attachment gets an ID, and you can assign that ID on you Customer (using a seperate table).

    All import/export/delete ... procedures you need allready exist on the attachment table.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.