Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Non-table based page

(0) ShareShare
ReportReport
Posted on by

Hello,

I have a problem with filling page using data not from source table.

Let me introduce the problem. Generally on the common driver I want to store some attachments. The directories are called by the name of customer, so the root directory would be common like "L:/attachments" and the next level of directories would be called by the customer name or No.. The problem is that I do not want to store the informations about attachments in any table. I just want to get to proper directory using directory root and the name of customer and get attachments. Now I am struggling with how to create page that is not based on any table.

Is someone who was programming it?

Regards,

Grzegorz Szwed

*This post is locked for comments

  • Verified answer
    RE: Non-table based page

    You might be able to use the Integer table and write the record fetching logic yourself.

    Peik have examples here (where he uses the output from a Query object on a report and a page):

    https://dynamicsuser.net/nav/b/peik/posts/using-dynamics-nav-2013-query-objects-in-reports-and-pages

  • Suggested answer
    RE: Non-table based page

    Hey,

    I have solved the problem by using fake customer records.

    To the customer card I have added the factbox - AttachmentFactBox which was linked to new page (based on temporary customer table with two columns "name" and "extension").

    pastedimage1569480748315v3.png

    In following code I have based on that article

    http://www.waldo.be/2013/01/07/nav2013-how-to-link-a-factbox-in-code/

    In new page I have created the method called FindTheDocuments(customerRec : Record Customer) which is searching for the proper files.


    FindTheDocuments(customerRec : Record Customer)
    Rec.RESET;
    CLEAR(Rec);
    
    IF customerRec."No." <> '' THEN
      BEGIN
        pathFile := STRSUBSTNO('%1\%2\%3',vendorDirectory,COMPANYNAME,CONVERTSTR(customerRec."No.",'\','_'));//RECEIVE THE ROOT DIRECTORY
    
        IF DN_Directory.Exists(pathFile) THEN
          BEGIN
            DN_List := DN_List.List();
            DN_List.AddRange(DN_Directory.EnumerateFiles(pathFile));
            IF DN_List.Count <> 0 THEN
              BEGIN
                FOR index:=0 TO DN_List.Count-1 DO
                  BEGIN
                    newNo:='L'   FORMAT(index);
                    Rec.SETRANGE(Rec."No.",newNo);
                    IF NOT Rec.FINDSET THEN
                      BEGIN
                        Rec."No.":=newNo;
                        INSERT(FALSE);
                        CurrPage.UPDATE(FALSE);
                      END;
    
                    Rec.RESET;
                  END;
              END;
          END;
      END;

    In Customer Card [page in trigger OnAfterGetCurrRecord this method was called

    pastedimage1569480693339v2.png

    So for now in memory of Rec there are some fake customer records, using the "No." in OnAfterGetRecord [in factbox page the number of index were read so the fields can be populated.

    OnAfterGetRecord()
    i := DELCHR(Rec."No.",'=','L');
    IF EVALUATE(index,i) AND (index < DN_List.Count ) AND (index>=0) THEN
      BEGIN
        nameFile:=DN_Path.GetFileNameWithoutExtension(DN_List.Item(index));
        extensionFile:=DN_Path.GetExtension(DN_List.Item(index));
      END
    ELSE
      BEGIN
        nameFile:='';
        pathFile:='';
        extensionFile:='';
      END
    

    I am beginning my story with programing in Navision so I am extremely open for the suggestions and any modifications.

    Regards,

    Grzegorz Szwed

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans