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

Notifications

Announcements

No record found.

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)
  • Suggested answer
    Zaid Tariq Profile Picture
    2,274 on at

    Hi,

    Can you give me an example with screenshot to understand the problem in detail?

    Thanks

  • spyroot Profile Picture
    1,647 on at

    Sure, as you can see on pic, I have created an "Attachment" field. I'm trying to make it as flowfield so it can change to TRUE when a external document is been linked to order otherwise always show be FALSE.

    flowfield.png

    If you have other ideas, I will be more than happy to heard them.

    Thank you.

  • ManishS Profile Picture
    86 on at

    I would not be possible using the flowfield, you need to write code on the page.

    OnAfterGetRecord Trigger.

    RecRef.GETTABLE(Vendor);

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

    IF RecordLink.FINDFIRST

  • spyroot Profile Picture
    1,647 on at

    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;

  • Suggested answer
    ManishS Profile Picture
    86 on at

    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;

  • ManishS Profile Picture
    86 on at

    You need to write code OnAfterGetRecord of purchase header table.

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

  • spyroot Profile Picture
    1,647 on at

    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

  • Suggested answer
    Mouli Kaku Profile Picture
    517 on at

    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

    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

    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);

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans