Next Steps after installation

On completion of the installation for the first time, the application is ready to be provisioned for its specific use.

Always test the installation first (see below) If the connection test fails, consult the common installation errors section to resolve it. Thereafter, before using the Connector, the metadata structure must be updated, and the class tables must be setup. This is achieved by either:

  • using the procedure spMFSetup_Reporting as discussed in more detail in Reporting : Quick start , or

  • Follow the steps below or

  • see the section Using example scripts below and follow the script ‘Getting Started’ to complete the first steps and getting to know the Connector.

After the metadata structure is refreshed, and the targeted class tables are created, the Connector can be used.

Note that the steps below and all the different options are discussed in much more detail in different sections in this guide.

Test installation

The first step is to test that the installation was done correctly and that the Connector can access the M-Files vault.

Execute the following procedure to test that the Connector can access the vault.  This procedure can be executed even before metadata have been synchronized.

EXEC spMFVaultConnectionTest

Update metadata Structure

Update the metadata structure by using the following procedure

EXEC spMFSynchronizeMetadata

The vault is now ready to design the usage of the Connector and add the related Class tables.

View available class tables

Use the following procedure to get a listing of all the classes in the vault.

SELECT * FROM MFClass

Create first Class Table

The following procedure will create a class table such as Customer.

EXEC spMFCreateTable @ClassName = 'Customer'

Note that the table will be created with the TableName as per the MFClass Table. Perform a select statement on the table to view the columns that has automatically be created.

Update Records in Class Table

The records can now be updated from M-Files by executing the update procedure. Note that class tables will take some time to update. If there are many records in the class then consult the section on UpdateTable for further guidance when large datasets are updated.

EXEC spMFUpdateTable
       @MFTableName = N'MFCustomer'
     , @UpdateMethod = 1

Perform another select statement on the table to view the records.

Create and update many class tables at once

When an installation uses many class tables, set them up in bulk rather than one at a time. The IncludeInApp column of the MFClass table marks which classes belong to the application, and the bulk procedures work on all classes with a given IncludeInApp value.

  1. Set IncludeInApp on the classes to include, by class name:

    UPDATE dbo.MFClass
    SET IncludeInApp = 1
    WHERE Name IN (N'Customer', N'Purchase Invoice', N'Project');
    
  2. Create the class tables with spMFCreateAllMFTables. It creates a table for each class with that IncludeInApp value whose table does not exist yet, and leaves existing tables as they are.

    EXEC dbo.spMFCreateAllMFTables @IncludedInApp = 1;
    
  3. Load the records from M-Files with spMFUpdateAllncludedInAppTables. @IncludeClass is a comma-separated list of IncludeInApp values.

    DECLARE @ProcessBatch_ID INT;
    
    EXEC dbo.spMFUpdateAllncludedInAppTables
         @IncludeClass    = N'1',
         @IsIncremental   = 0,
         @ProcessBatch_ID = @ProcessBatch_ID OUTPUT;
    
  4. Optionally, create the value list and workflow state lookup views for these class tables with spMFCreateAllLookups.

Use different IncludeInApp values to group classes that are created or updated on different schedules. Columns for additional properties, which are not on a class’s metadata card, can be created in advance; see spMFCreateTable. To remove the class tables again, see spMFDropAllClassTables.

Note

The procedure name has no “I” after “All”: spMFUpdateAllncludedInAppTables. Some pages and scripts spell it spMFUpdateAllIncludedInAppTables and mean this procedure, but a call must use the installed name.

Ready for real action

You are now ready for real action. Follow the section on using the Connector to plan and execute your application of the connector. This will provide more information on how to use this guide.

Using example scripts

Examples scripts for the most common procedures and functions are included in the installation package. The scripts are also included as downloads in this guide in the sections where applicable. The scripts are prepared using a standard M-Files Sample vault and will include illustrations usingobjects from this vault.

The scripts are located at:

  • InstallationFolder\Laminin Solutions\MFSQL Connector Release 4\DatabaseName\Example Scripts

Open the scripts in SSMS. Follow the guidelines in the scripts to select the instructions in blocks rather than executing the entire script.

Use the scripts in conjunction with this guide. The script only include a brief explanation or guide for the use of the different procedures and is not intended to replace this guide.