Business Integration Solutions Documentation

How to: Create Templates

Use this task to create a new template based on an existing connection

To create a template using connections:

  1. From the connections page, create the structure that you need to be saved
  2. Under the actions menu, you have the option "Save As Template"
  3. On the page that opens, specify the following fields:
Field Description Editable
Template Name Provide a unique code for the new template. If you specify an existing name, the template will be overwritten.
Template Description Provide a description for the new template
Version Date Stamp The date time the connection has been published, or the current date time if the connection is in design mode

SaveAsTemplate

  1. Once you click ok, the new template can be found at page "BIS Templates" and it is ready for use when creating new connections.
Field Description
No. Template name
Description Template description
Deployment method Can have three values: "Manual", "Create" or "Create and Update". Dictates what happens with the templates when the app is installed/updated (see table below for details)
Version Templates latest version date stamp
Deployment Method Description
Manual The template is not handled by the app install/update procedures, connections need to be manually created from it
Create The template is handled by the app install/update procedures, one connection gets created from the template if it doesn't exist already
Create and Update The template is handled by the app install/update procedures, one connection gets created from the template if it doesn't exist already and all the other connections linked to this template, get updated

SaveAsTemplate

  1. Templates support multiple versions of the same connection, based on the Version Date Stamp field. These version can be seen using the action "Versions" from the templates page

SaveAsTemplate

  1. The export to AL action will create a template subscriber codeunit based on details from the template. Once you choose an ID for the codeunit and click ok, a file will be downloaded for you that you can use further.

This subscriber, if included in your app solution, will get invoked when the app install/update procedure happens.

codeunit 50000 UNIQUETEMPLATE implements BISITemplate
{ 
    ///<summary>
    ///This codeunit contains autogenerated code from To-Increase
    ///</summary>

    local procedure GetConnection(var SourceType: Integer; var ConnectionNo: Code[20]; var ConnectionDescription: Text[100]; var ContentBlob: Codeunit "Temp Blob"; var TimeStamp: DateTIme; var DeploymentMethod: Enum BISTemplateDeployment)
    var
        TICConversion: Codeunit "TIC Conversion Functions";
        Content: Text;
    begin
        SourceType := 11032000;
        ConnectionNo := 'UNIQUETEMPLATE';
        ConnectionDescription := 'Unique template version 1';
        Evaluate(TimeStamp, '<06/29/22 07:22 AM>');
        DeploymentMethod := DeploymentMethod::Create;
        Content := 'Templates content in a base64 format';
        TICConversion.Text2BLOB(Content, ContentBlob);
    end;

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"BIS Product Registration", 'LoadConnectionTemplate', '', false, false)]
    local procedure LoadConnectionTemplate(PackageMgmt: Codeunit "BIS Package Helper")
    var
        TempBlob: Codeunit "Temp Blob";
        SourceType: Integer;
        ConnectionNo: Code[20];
        ConnectionDescription: Text[100];
        TimeStamp: DateTime;
        DeploymentStatus: Enum BISTemplateDeployment;
    begin
        GetConnection(SourceType, ConnectionNo, ConnectionDescription, TempBlob, TimeStamp, DeploymentStatus);
        PackageMgmt.CreateNewTemplate(SourceType, ConnectionNo, ConnectionDescription, TempBlob, TimeStamp, DeploymentStatus);
    end;
} 

How to: Create Connection Using Template

Use this task to create connections based on a saved template.

To create connection using template:

  1. Depending on the solution, open or create:
  • Connections for Connectivity Studio.
  • Notifications for Notification Management.
  • Publications or Subscriptions for Replication Management.
  • EDI Connections for EDI Studio.
  1. Click New to create a new connection.
  2. On the Create New Connection dialog, specify the following fields:
Field Description
What is the identifier of the connection? Provide a unique code for the new connection.
How do you want to create this connection? Select Create from Template from the drop down list.
Which template do you want to use? From the drill down, select the template using which you want to create a new connection.
Which template version do you want to use? Defaults to the templates latest version, but can be changed to any other available version, using the drill down functions on the field.

SaveAsTemplate

When you drill down to select the template, notice that templates are listed corresponding to the solution, i.e. for connections only Connectivity Studio related templates are listed; for notifications only Notification Management related templates are listed and so on. 4. Click Ok. 5. On the confirmation dialog that pops up stating the successful creation of a new connection, click Ok.

The connection, pipeline and related documents for the new connection are based on the template selected.

SaveAsTemplate5