SharePoint Connector Documentation
Index

Extending the UI

This page provides guidance for partners and developers on extending the SharePoint Connector to additional pages.

Overview

The SharePoint Connector can be extended to show the SharePoint FactBox on additional pages beyond those included by default.

When to Extend

Common Extension Scenarios

  • Custom pages for standard tables
  • Pages for custom tables
  • Industry-specific page extensions
  • Additional list pages

Prerequisites

Before extending:

  1. Table mapping must exist for the source table
  2. Your extension must depend on the SharePoint Connector
  3. Understand the page structure

App Dependency

Adding Dependency

In your extension's app.json, add a dependency:

{
  "dependencies": [
    {
      "id": "23ebd065-b289-4a68-85e3-b8410e360157",
      "name": "SharePoint Connector",
      "publisher": "hougaard.com",
      "version": "6.0.0.0"
    }
  ]
}

App ID

The SharePoint Connector app ID is 23ebd065-b289-4a68-85e3-b8410e360157, published by hougaard.com.

Page Extension Pattern

Basic Structure

pageextension 50100 "My Page Extension" extends "Target Page"
{
    layout
    {
        addfirst(FactBoxes)
        {
            part(SharePointFactBox; "SharePoint Factbox EFQ")
            {
                ApplicationArea = All;
                SubPageLink = "Source Table" = const(TableNumber),
                              "Source ID" = field(SystemId);
                Visible = SharePointVisible;
            }
        }
    }

    var
        SharePointVisible: Boolean;

    trigger OnAfterGetRecord()
    begin
        SharePointVisible := HasSharePointMapping();
    end;

    local procedure HasSharePointMapping(): Boolean
    var
        TableMapping: Record "Table Mapping EFQ";
    begin
        exit(TableMapping.NeedsFactBox(Database::YourTable));
    end;
}

Key Elements

Element Purpose
Part Adds the FactBox
SubPageLink Links to current record
Visible Controls visibility
Source Table Table number constant
Source ID System ID of record

Visibility Logic

The NeedsFactBox Procedure

The Table Mapping EFQ table has a NeedsFactBox procedure that controls FactBox visibility. It checks three conditions:

  1. License registration: In SaaS production or on-premises, the license must be registered (via the License Management EFQ codeunit). In sandbox environments, no registration is needed.
  2. Table mapping existence: A table mapping record must exist for the given table number.
  3. Mapping method: The mapping method must not be "Only Columns" (which is used for metadata-only mappings without file display).

If all three conditions are met, the FactBox is shown.

Using NeedsFactBox

local procedure HasSharePointMapping(): Boolean
var
    TableMapping: Record "Table Mapping EFQ";
begin
    exit(TableMapping.NeedsFactBox(Database::Customer));
end;

License Considerations

The NeedsFactBox procedure internally checks licensing:

  • In SaaS sandbox environments, the FactBox is always available (trial mode)
  • In SaaS production environments, the license must be registered or the FactBox will not show
  • In on-premises environments, the license must be registered or the FactBox will not show

Example Extensions

Extending Customer Card

If you have a custom Customer Card page:

pageextension 50101 "Custom Customer Card Ext" extends "Custom Customer Card"
{
    layout
    {
        addfirst(FactBoxes)
        {
            part(SharePointFiles; "SharePoint Factbox EFQ")
            {
                ApplicationArea = All;
                SubPageLink = "Source Table" = const(18),
                              "Source ID" = field(SystemId);
            }
        }
    }
}

Extending a List Page

pageextension 50102 "Custom List Ext" extends "Custom List"
{
    layout
    {
        addfirst(FactBoxes)
        {
            part(SharePointFiles; "SharePoint Factbox EFQ")
            {
                ApplicationArea = All;
                SubPageLink = "Source Table" = const(YourTableNo),
                              "Source ID" = field(SystemId);
            }
        }
    }
}

Custom Tables

Adding SharePoint to Custom Tables

For your own tables:

  1. Create a table mapping for your table
  2. Add the FactBox to your pages
  3. Test file upload/download

Table Requirements

Your table should have:

  • SystemId field (standard)
  • Fields for folder naming (Folder Name Field No.)
  • Proper primary key

Mapping Configuration

Create mapping for your table:

Field Value
Table No. Your table number
Folder Name Base folder name
Folder Name Field No. Field for folder naming
Mapping Method As appropriate

Testing Extensions

Development Testing

  1. Deploy extension to sandbox
  2. Configure table mapping
  3. Open extended page
  4. Verify FactBox appears
  5. Test upload/download

Checklist

  • FactBox visible on page
  • Files display correctly
  • Upload works
  • Download works
  • Navigation works
  • Visibility logic correct

Troubleshooting Extensions

FactBox Not Appearing

Check Resolution
Part added correctly? Review page extension code
SubPageLink correct? Verify table number and field
Mapping exists? Create table mapping
Visibility logic? Check visible condition
Issue Check
Wrong record showing SubPageLink configuration
No record linked SystemId field used?

Best Practices

Code Quality

Practice Benefit
Use constants Avoid magic numbers
Add visibility logic Only show when relevant
Test thoroughly Catch issues early
Document Future maintenance

Performance

Consideration Recommendation
Page load Visibility check should be fast
Multiple FactBoxes Consider user experience