Link Documents to Contacts in NAV 4

attardcattardc Member Posts: 97
Hello there

Can anyone tell me if I can link documents to contacts / interactions in NAV 4.01? I know it's doable in NAV 5 onwards, just wondering if there was something similar in previous versions :)

Thanks

Chri

Comments

  • lvanvugtlvanvugt Member Posts: 774
    Nio, not standard. You have to build something yourself.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • SavatageSavatage Member Posts: 7,142
    It's real easy 1 table 1 form. (For use with the older versions)
    viewtopic.php?f=23&t=23783

    Create a Linked Attachments Table (50000+ range)
    add fields..
    Field No. Field Name Data Type Length Description
    10 Type Option
    20 No. Code 20
    30 Attachment Text 220
    40 Open Boolean
    50 Date Modified Date

    KEY=Type,No.,Attachment

    Your type options will be..
    ,Customer,Vendor,Item,Deposit,Contact,(more if you wish)

    Create a form (50000+ range)
    Tablebox ->drop in all the fields.

    *Add Some Globals
    Name - DataType - Subtype
    Links - Record - Linked Attachments
    CommonDlgMgt - Codeunit - Common Dialog Management

    On the Attachment field add this code to look up the things you want to attach.
    OnAssistEdit()
    Attachment := CommonDlgMgt.OpenFile( FIELDCAPTION( Attachment), Attachment, 4, '*.*', 0);
    

    OnPush() (of the "OPEN" field)
    HYPERLINK(Attachment);
    Links.GET(Type,"No.",Attachment);
    CLEAR(Open);
    "Date Modified" := WORKDATE;
    MODIFY;
    

    Then to access it from the cards (item,vendor,customer,contact, etc etc) Basically same as your options
    Add a command button to the card (customer in this example) Caption "Attachments"
    The Properties of the button =
    PushAction = RunObject
    RunObject = Form Linked Attachments
    RunFormLink = Type=CONST(Customer),No.=FIELD(No.)
    

    for the button on the item card you just change it to
    RunFormLink = Type=CONST(Item),No.=FIELD(No.)
    
    For the button on the contact card you change it to
    RunFormLink = Type=CONST(Contact),No.=FIELD(No.)
    

    etc.etc. for the other cards you want to have attachments available.
    Since it's a hyperlink you can have any type of attachment
    from c:\mytextfile.txt to http://www.mibuso.com
    and Xls should open right to excel & any Doc right to word - Pdf - to acrobat, etc

    The attachment field has an assistedit to find your attachment.
    Click on the "Open" field to goto the attachment

    Save->Compile->Enjoy!
Sign In or Register to comment.