MFSQL Connector

FAQ:

  • Frequently asked questions

MFSQL Connector Guide:

  • Introduction to MFSQL
  • Getting Started
  • MFSQL Data Exchange and reporting Connector
  • MFSQL Integration Connector
  • The Connector Framework
  • Version Control
  • Version 5 Development

Blog:

  • List of blogs
    • Advanced updating of Valuelists from external source
    • Align metadata from an external source with data in M-Files
    • Aligning valuelist items with different owners
    • Perform a background operation in SQL on workflow change
    • Building applications around M-Files
    • Certified Application Developer presentation
    • Changing the class of an object
    • Changing from single lookup to multi lookup
    • Considerations for deleted records
    • Considerations for large volume vault
    • Create a scheduled pull from M-Files using SQL Server Agent
    • Creating and using public shared link
      • Pre-requisits
      • Step by step guide
    • Creating multiple related objects on file import
    • CRM and Emailer Management
    • Deleting duplicate objects
    • Exporting files from a vault
    • ExternalID versus DisplayID versus Objid
    • Explore all the objects in the vault
    • Get number of records in Class
    • Working with object change history
    • Getting started with a custom application
    • Getting to know MFSQL Connector
    • How to generate a quick follow up list
    • Illegal XML Characters
    • Importing files into M-Files
    • Insert new records from SQL
    • Integration for vendor approval
    • Integration whitepaper
    • Integration with SAGE 200 - Case Management
    • Integration with SAGE 50
    • Integration with test equipment
    • Integration with Vendor Management and Purchasing with Epicor Enterprise
    • Mark for Archiving using Class Table
    • Metadata Management and data cleansing
    • Metadata Management and Realignment Case Study
    • MF-Last-Modified-User in action
    • Moving documents from one class to another
    • Moving metadata from text properties to Valuelist items
    • MultiSelectLookups
    • Near real time reporting
    • Online Ordering of special stock
    • Online Quote System
    • Practical use of logging in Procedures
    • Processing scanned documents
    • Properties with multi lookup datatypes
    • Limitations of real datatype
    • Report designers and the Connector
    • Reports from the extended Event log
    • Restore MFSQL database to a different server
    • RPC over HTTPS setup
    • Setting up a workflow state change
    • Setup Agent Proxy for MFSQLConnect
    • Status report using context menu
    • Table relations - views for reporting
    • Update large tables using batch mode
    • Upgrading to VAF 10.4
    • Updating a multi lookup property on an object
    • Updating incorrect properties across multiple related classes
    • Updating only records that changed
    • Updating millions of records
    • Using delimiter functions
    • Using event handler for SQL action
    • Using hyperlinks with MFSQL Connector
    • Using M-Files External Connector
    • Using spMFClassTableStats
    • Using the External_ID to match third party app tables
    • Using windows authentication
    • Working with Additional Properties
    • Working with checked Out objects
    • Working with date and time
    • Working with Document Collections

SQL Components:

  • Procedures
  • Tables
  • Functions
  • Views
  • Triggers
MFSQL Connector
  • Docs »
  • List of blogs »
  • Creating and using public shared link

Creating and using public shared link¶

MFSQ: Connector allows for creating a public shared link to an object on demand.

Currently this capability is limited to single file object. Multifile objects and collections cannot be accessed. Accessing multifile objects and collections is on the roadmap and is awaiting demand for the functionality to prioritise the development.

It is simple to use: set the process_id on the class table to say 6 for all the target records; run procedure , spMFCreatePublicSharedLink; and access the link in the table MFPublicLink.

Pre-requisits¶

M-Files must be setup for Web services and have the url in the M-Files Web setting in the vault properties.

The following two settings must be exist and be correct in MFSettings table:
  • ServerURL

  • VaultGUID

Use the following script to setup or change these settings.

DECLARE @GUID NVARCHAR(100);
DECLARE @WebURL NVARCHAR(100);

SET @GUID = N'{5981E340-C62F-4DB0-8E22-684AD012E5F6}'; --replace this with the GUID, including the curley brackets
SET @WebURL = N'http://lsuk-app03.lsusa.local'; --replace with your web url

IF EXISTS (SELECT * FROM dbo.MFSettings WHERE Name = 'VaultGUID')
 BEGIN
 EXEC dbo.spMFSettingsForVaultUpdate @VaultGUID = @GUID;
 END;
 ELSE
BEGIN
INSERT dbo.MFSettings
(
    source_key,
    Name,
    Description,
    Value,
    Enabled
)
VALUES
(N'MF_Default', N'VaultGUID', N'GUID of vault', @GUID, 1);
END;

IF EXISTS (SELECT * FROM dbo.MFSettings WHERE Name = 'ServerURL')
BEGIN
EXEC dbo.spMFSettingsForVaultUpdate @ServerURL = @WebURL;
END;
ELSE
BEGIN
INSERT dbo.MFSettings
(
    source_key,
    Name,
    Description,
    Value,
    Enabled
)
VALUES
(N'MF_Default', N'ServerURL', N'Web URL for M-Files', @WebURL, 1);
END;

Step by step guide¶

Links can be created in bulk and on demand and can be built into other procedures. For instance, the links can be created in the back ground and added back as a property on the object. This allows for the link to become available for use on the object itself. Another use case is to bulk create the links and to include the links in an email to a selection of customers.

Example http://ServerDNS/SharedLinks.aspx?accesskey=fd69f8b5e1a02a567ebd164dfea337b3fe2b92d3296df3d698bf6d2354cba983&VaultGUID={3E2585FF-ED4F-4EEF-888D-B7AD475195B9}


Step 1: Update the process_id of the target records

--Update a record where singlefile = 1 and set process_ID = 1

update [od]
set [od].[Process_ID] = 1
FROM   [MFOtherDocument] od where [Single_File] = 1

Step 2: Set the expiry date and run the procedure

DECLARE @Expiredate DATETIME = DATEADD(m, 1, GETDATE())
-- set expiredate to 1 month from today
EXEC [spMFCreatePublicSharedLink] @Tablename = 'MFOtherDocument'
, @Expirydate = @Expiredate
, @processID = 6

Step 3: Use the link from the public link table.

--show links for a specific Project
SELECT [mod].[Project], mod.[Name_Or_Title], mpl.link AS FileURL
FROM [dbo].[MFOtherDocument] AS [mod]
INNER JOIN [dbo].[MFPublicLink] AS [mpl]
ON [mod].objid=mpl.[ObjectID] AND mod.class_ID = mpl.[ClassID]
WHERE [mod].[Project] = 'Office Design'
Next Previous

© Copyright 2023, Laminin Solutions Ltd

Built with Sphinx using a theme provided by Read the Docs.