Business Integration Solutions documentation

How to: Set up the fact box for drag and drop

You can add the Document Management fact box to virtually any page and use the drag-and-drop feature to archive and link documents to a record.

To add the Document Management fact box to a page:

  1. Open the Microsoft Dynamics NAV development environment.
  2. Select the page object.
  3. Open the page designer.
  4. Add the following part in a FactBoxArea:
Type SubType Name Caption PagePartID
Part Page DocMgtFactBox Document Management N108 Document Mgt. Factbox (in Properties)
  1. Go to the C/AL Editor and add the following local variable in the OnAfterGetCurrRecord() trigger:
Name DataType Subtype
DocMgtRecRef RecordRef -
  1. Add the following code in the OnAfterGetCurrRecord() trigger:

    //For Document Management
    DocMgtRecRef.GETTABLE(Rec);
    IF DocMgtRecRef.GET(DocMgtRecRef.RECORDID) THEN BEGIN
      CurrPage.DocMgtFactBox.PAGE.SetSource(DocMgtRecRef.RECORDID);
      CurrPage.DocMgtFactBox.PAGE.RefreshList;
    END;
    
  2. Compile the page object.

  3. Open the page in RTC to check the result.