Add the SharePoint FactBox to any page

The SharePoint connector comes with the SharePoint factbox installed on many pages, but maybe you want the factbox somewhere else?

Not a problem, you can create an extension that takes dependency to the SharePoint Connector and add the fact box to all the pages you need. (Or your partner can if you give them a link to this page).

First add the dependency to your app.json like this:

{
  "id": "23ebd065-b289-4a68-85e3-b8410e360157",
  "name": "SharePoint Connector",
  "publisher": "E Foqus Canada Inc.",
  "version": "1.0.0.10"
}

Then add one or more pageextension objects to cover the places you need the factbox. Use the below snippet as a template. The only thing you need to do, is edit the first line with:

  • Give it an object number
  • Give it an name
  • Replace the “Page Name” with the name of the page
pageextension 50000 "Extend a page" extends "Page Name"
{
    layout
    {
        addfirst(factboxes)
        {
            part(SharePointPart_EFQ; "SharePoint Factbox EFQ")
            {
                ApplicationArea = All;
                Visible = SharePointActivated;
            }
        }
    }
    trigger OnAfterGetCurrRecord()
    var
        Ref: RecordRef;
        Parms: Dictionary of [Text, Text];
        PageTaskId: Integer;
    begin
        Ref.GetTable(Rec);
        CLEAR(Parms);
        Parms.Add('folder', CurrPage.SharePointPart_EFQ.Page.PrepareFill(Ref));
        CurrPage.EnqueueBackgroundTask(PageTaskId, Codeunit::"Factbox Background Task EFQ", Parms, 30000, PageBackgroundTaskErrorLevel::Warning);
    end;

    trigger OnPageBackgroundTaskCompleted(TaskId: Integer; Results: Dictionary of [Text, Text])
    begin
        CurrPage.SharePointPart_EFQ.Page.FinishFill(Results);
    end;

    trigger OnPageBackgroundTaskError(TaskId: Integer; ErrorCode: Text; ErrorText: Text; ErrorCallStack: Text; var IsHandled: Boolean)
    begin
        CurrPage.SharePointPart_EFQ.Page.FillError(ErrorText);
    end;

    trigger OnOpenPage()
    var
        TableMapping: Record "Table Mapping EFQ";
        Ref: RecordRef;
    begin
        Ref.GetTable(Rec);
        SharePointActivated := TableMapping.NeedsFactBox(Ref.Number());
    end;

    var
        SharePointActivated: Boolean;
}

That’s it, now you have added the SharePoint connector to the page and connected it to the data (Rec).


Enjoy 4 free months of Dynamics Sales Professional (CRM)

We are excited to share with you a promotion from Microsoft (effective August 3, 2020) for Dynamics Sales Professional and Customer Service Professional (CRM) subscription licenses for new customers in Canada.

In today’s environment, businesses are expected to be even more agile, adjusting and adapting existing processes in response to new employee and customer needs. We have also seen a market trend towards connecting your ERP and CRM data, tying your financial, operational, and customer data from various disparate sources, giving you a a complete 360-degree view of your business activities.

In response to this Microsoft is offering 4 months at no cost with a 1-year commitment. To qualify, you must be brand new to Dynamics CRM or have cancelled or expired subscription (within the last 30 days). This offer is open to all geographies where Dynamics Sales Professional and Customer Service Professional is available

If you would like to learn more about this promotion and how it may benefit your organization, please contact info@efoqus.ca