다음을 통해 공유


Walkthrough: Connecting a Microsoft Dynamics NAV List Page to a Document Library

The following walkthrough demonstrates how to add a Microsoft Dynamics NAV Web Part on a SharePoint site that displays a list type page, and then connect the Microsoft Dynamics NAV Web Part to a SharePoint document library.

About This Walkthrough

This walkthrough illustrates the following tasks:

  • Creating the Document Library

  • Hiding Elements of the Item List Page

  • Creating the Web Part Page that Contains the Item List and the Document Library

  • Connecting the Document Library Web Part to the Item List Web Part

Roles

This walkthrough demonstrates tasks that are performed by the following user roles:

  • Microsoft Dynamics NAV developer and IT Pro.

  • SharePoint application developer and super-user.

Prerequisites

To complete this walkthrough, you will need:

  • CRONUS International Ltd. demonstration database

  • Microsoft Dynamics NAV Windows client

  • A SharePoint site that is running Microsoft Dynamics NAV Portal Framework

  • Microsoft Office Word 2003 or later versions

Story

Viktor is a partner working for CRONUS International Ltd. Viktor has been asked to display page 31, Item List, on the company’s SharePoint site. In addition, he has been asked to set up a document library that will contain documents that are related to items in the Item List page. Each document in the library will be assigned an item number that matches an item in the Microsoft Dynamics NAV database. Viktor will display the document library on the same page on the SharePoint site as the Item List. He will configure the document library to display only documents that have the same item number as the item that is selected in the Item List.

To accomplish this, Viktor will create a Web Parts page that contains two Web Parts. He will set up one Web Part to contain the Item List page and another Web Part to contain the document library. After he has added the two Web Parts, he will connect them to filter the data in the document library based on a selected item in the Item List page. The following illustration shows an example of the page that Viktor will create. In this example, the item 1001, Touring Bicycle, has three associated documents in the document library.

Connection between item list and document library

Creating the Document Library

The document library will hold several Microsoft Word files that contain information about items in the Items List. Viktor will create a document library using the library feature that is available in SharePoint. He will add an additional field to the library that users will use to type the number of the item from the Item List that documents pertain to.

To create the document library

  1. Open the SharePoint site in your browser.

  2. On the Site Actions menu, choose New Document Library.

  3. In the Name field, type Item Library.

  4. Keep the default values for the remaining fields, and then choose Create.

  5. To add a column, in the ribbon, choose the Library tab, and then choose Create Column.

    You will add a new column for entering the item number assigned to the document.

  6. In the Column name field, type Item No., and then choose the OK button.

To create and upload the documents to the document library

  1. Create several Word documents for the document library and put them in a location on a computer that can be accessed from your SharePoint sites.

    For this walkthrough, the content of the documents is not important.

  2. In the document library on SharePoint, choose Add document.

  3. In the Item Library – Upload Document window, choose Browse

  4. Select the file, and then choose Open.

  5. Choose the OK button.

  6. In the Item No field, type a number of an item in the Item List.

  7. Choose the Save button.

  8. Repeat steps 2 through 7 to add more documents.

Hiding Elements of the Item List Page

The Item List page contains several columns and FactBoxes. Viktor understands that space is limited on the SharePoint site, so he only wants to show columns that are required for users to do their work on the SharePoint site. After talking with the customer, he decides that he will not show the FactBoxes and will only show the No. and Description columns. To do this, he runs the Microsoft Dynamics NAV Windows client in the configuration mode for the Order Processor profile, which is the profile that is assigned to users who work with Microsoft Dynamics NAV items.

Note

In this walkthrough, Viktor configures the Microsoft Dynamics NAV Windows client for the Order Processor profile. In a typical business scenario, you would create a separate profile for SharePoint users.

To configure the Item List page

  1. Make yourself the owner of the Order Processor profile.

    For information about how to make yourself a profile owner, see How to: Create a Profile.

  2. On the computer that is running the Microsoft Dynamics NAV Windows client, open a command prompt, and type the following command to open the installation folder of the Microsoft Dynamics NAV Windows client.

    cd C:\Program Files (x86)\Microsoft Dynamics NAV\70\RoleTailored Client
    

    Substitute C with the drive for your installation.

  3. Type the following command to open page 31, Item List in the Microsoft Dynamics NAV Windows client.

    Microsoft.Dynamics.Nav.Client.exe -configure -profile:"Order Processor" "DynamicsNAV:////RunPage?Page=31"
    

    The Order Processor Role Center opens to the Item List page. The text Configuration Mode appears in the heading.

  4. To hide the FactBox area, on the Application menu, choose Customize, and then choose FactBox pane.

    The FactBox is removed from the page.

  5. To hide columns, choose Customize, and then choose Choose Columns.

  6. In the Customize Item List window, under Show columns in this order, use the Remove button to remove all columns except No. and Description.

  7. Choose the OK button when you are finished.

Creating the Web Part Page that Contains the Item List and the Document Library

Viktor will create a new SharePoint Web Part page, and the document library and a Microsoft Dynamics NAV Web Part for the Item List page. Viktor identifies the Item List as the provider in the Web Part connection, so he will add the Item List page before the Document Library.

  1. Open the SharePoint site in your browser.

  2. On the Site Actions menu, choose More Options.

  3. Under Pages and Sites, choose Web Part Page.

  4. In the Name field, type Items Web Part.

  5. In the Choose a Layout Template field, choose a template, and then choose Create.

    The new Web Part page opens.

To add the Item List page to a Microsoft Dynamics NAV Web Part

  1. In box where you want to add the Microsoft Dynamics NAV Web Part, choose Add a Web Part.

  2. In the Categories pane, select Miscellaneous, select Microsoft Dynamics NAV Web Part, and then choose Add.

  3. In the Microsoft Dynamics NAV Web Part, choose the Open the tool pane link.

    The Item Library displays all documents that have been uploaded.

  4. In the tool pane on the right, in the NAV page box, select the Item List page, and then choose the OK button.

To add the Document Library to a Web Part

  1. In the box where you want to add the document library, choose Add a Web Part.

  2. In the Categories pane, choose Lists and Libraries.

  3. In the Web Parts pane, choose Item Library, and then choose Add.

    The Item Library displays all documents that have been uploaded.

Connecting the Document Library Web Part to the Item List Web Part

Viktor wants the document library to display only those documents that have the same item number as an item that is selected in the Item List. To accomplish this, Viktor will set up a Web Part connection between the Microsoft Dynamics NAV Web Part and the document library that filters data on the item number. Viktor will set up the Microsoft Dynamics NAV Web Part as the data provider and the document library as the data consumer.

To add the Item List page to a Microsoft Dynamics NAV Web Part

  1. On the Web Part menu of the document library, choose Connections, choose Get Filter Values From, and then choose Microsoft Dynamics NAV Web Part.

  2. In the Configure Connection dialog box, under Connection Settings, set the Provider Field Name box to No. and the Consumer Field Name box to Item No..

  3. Choose the Finish button.

    To verify the connection, select an item in the Item List. The document library should change to display documents that are related to the item.

See Also

Tasks

How to: Display a Microsoft Dynamics NAV Page in a Web Part
How to: Connect a Microsoft Dynamics NAV Web Part

Concepts

Connecting Microsoft Dynamics NAV Web Parts to Other Web Parts
Understanding Microsoft Dynamics NAV Web Part Connections