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

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Link feature on NAV 2013

(0) ShareShare
ReportReport
Posted on by 1,647

Hello Folks,

Is there a way to show end user when a document (SO, PO, etc.) have a file attached on same page? At this point, end users must click the link button to find out if attachment exist or not.

I try to create a flowfield variable but I can't find the way to associate the Purchase table with the Record Link Table 2000000068.

Any suggestions are more than welcome.

*This post is locked for comments

I have the same question (0)
  • spyroot Profile Picture
    1,647 on at
    RE: Link feature on NAV 2013

    That works!!!

    You made my day, thank you so much.

  • Verified answer
    ManishS Profile Picture
    86 on at
    RE: Link feature on NAV 2013

    Instead of  RecRef.GETTABLE(PurchHdr) write RecRef.GETTABLE(Rec);

  • spyroot Profile Picture
    1,647 on at
    RE: Link feature on NAV 2013

    Thank you Mouli for the help, but on my scenario I'm trying to use the link feature located on top ribbon that comes with NAV2013. The code you provide may not work.

  • Suggested answer
    Mouli Kaku Profile Picture
    517 on at
    RE: Link feature on NAV 2013

    Hi Alex,

    This is my working Code

    Sales Shipment Header - OnAfterGetRecord()

    IF NOT "Sales Shipment Header".HasPoDRecordLink THEN BEGIN

     PoDFilepath := "S&RSetup"."Network Save Folder Path" + 'PoDs\' + "Sales Shipment Header"."No." + '.pdf';

     IF EXISTS(PoDFilepath) THEN BEGIN

       "Sales Shipment Header".ADDLINK(PoDFilepath,'POD');

       LinkCount += 1;

     END;

    END;

    HasPoDRecordLink() : Boolean

    IF NOT HASLINKS THEN

     EXIT(FALSE);

    RecordRef.GETTABLE(Rec);

    RedId := RecordRef.RECORDID;

    RecordLink.SETRANGE("Record ID", RedId);

    RecordLink.SETRANGE(Description,'POD');

    EXIT(NOT RecordLink.ISEMPTY);

  • spyroot Profile Picture
    1,647 on at
    RE: Link feature on NAV 2013

    I'm getting below error under EXIT(FALSE) with your suggestion, sorry

    pic_5F00_005.png

  • Suggested answer
    Mouli Kaku Profile Picture
    517 on at
    RE: Link feature on NAV 2013

    Try This

    HasPoDRecordLink() : Boolean

    IF NOT HASLINKS THEN

     EXIT(FALSE);

    RecordRef.GETTABLE(Rec);

    RedId := RecordRef.RECORDID;

    RecordLink.SETRANGE("Record ID", RedId);

    RecordLink.SETRANGE(Description,'POD');

    EXIT(NOT RecordLink.ISEMPTY);

  • spyroot Profile Picture
    1,647 on at
    RE: Link feature on NAV 2013

    Manish,

    Something I'm missing because still not working for me. Below is the code I wrote as suggested on purchase header PAGE and not on table:

    pic_5F00_003.png

    here are my global variables:

    6864.pic_5F00_002.png

    Link exist on purchase order:

    pic_5F00_004.png

    Dynamic field is not behaving as suppose to :(

    pic_5F00_003.png

  • ManishS Profile Picture
    86 on at
    RE: Link feature on NAV 2013

    You need to write code OnAfterGetRecord of purchase header table.

    Rather than passing a local variable of purchase header pass Rec (Current record).

  • Suggested answer
    ManishS Profile Picture
    86 on at
    RE: Link feature on NAV 2013

    I tried this and working.

    Attachment := FALSE;

    RecRef.GETTABLE(PurchaseHeader);

    RecordLink.SETRANGE("Record ID",RecRef.RECORDID);

    RecordLink.SETRANGE(RecordLink.Type,RecordLink.Type::Link);

    IF RecordLink.FINDFIRST THEN

     Attachment := TRUE;

  • spyroot Profile Picture
    1,647 on at
    RE: Link feature on NAV 2013

    Manish,

    The table should be purchase header and not vendor table right?

    Even that way is not working. What I'm missing?

    I have declared below variables:

    vars.png

    This is the code 

    RecRef.GETTABLE(PurchHdr);

    RecordLink.SETRANGE("Record ID",RecRef.RECORDID);

    IF RecordLink.FINDFIRST then

      "attachment box" := TRUE

    ELSE

      "attachment box" := FALSE;

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans