Signature

dbo.fnMFObjectHyperlink(
    @MFTableName     NVARCHAR(100),
    @MFObject_MFID   INT,
    @ObjectGUID      NVARCHAR(50),
    @HyperLinkType   INT = 1
)

Returns

NVARCHAR: an object hyperlink formatted for M-Files Desktop or New Web.

Parameters

@MFTableName
  • Type: NVARCHAR(100)

  • Required: Yes

  • Description: Valid class table name, e.g. ‘MFAccount’ or ‘MFCustomer’.

@MFObject_MFID
  • Type: INT

  • Required: Yes

  • Description: The ObjID value in the class table.

@ObjectGUID
  • Type: NVARCHAR(50)

  • Required: Yes

  • Description: The GUID value in the class table.

@HyperLinkType
  • Type: INT

  • Required: No (default = 1)

  • Description: Action type.
    • Desktop: 1=show, 3=view, 4=open, 5=show metadata, 6=edit

    • New Web: 2=show, 7=view, 8=open, 9=edit

Purpose

Use this function in a SELECT statement to generate an M-Files object hyperlink with different action modes.

Limitations

The hyperlinks work for objects and not files.

Examples

-- desktop - show (option 1)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 1)
FROM [dbo].[MFAccount] AS mc;

-- new style web - show (option 2)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 2)
FROM [dbo].[MFAccount] AS mc;

-- desktop - view (option 3)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 3)
FROM [dbo].[MFAccount] AS mc;

-- desktop - open (option 4)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 4)
FROM [dbo].[MFAccount] AS mc;

-- desktop - show metadata (option 5)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 5)
FROM [dbo].[MFAccount] AS mc;

-- desktop - edit (option 6)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 6)
FROM [dbo].[MFAccount] AS mc;

-- new style web - view (option 7)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 7)
FROM [dbo].[MFAccount] AS mc;

-- new style web - open (option 8)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 8)
FROM [dbo].[MFAccount] AS mc;

-- new style web - edit (option 9)
SELECT mc.[name_or_Title] AS Account,
       [dbo].[fnMFObjectHyperlink]('MFAccount', mc.[objid], mc.[guid], 9)
FROM [dbo].[MFAccount] AS mc;

Changelog

Date

Author

Description

2025-08-19

LC

Update to show new style web link

2020-05-18

LC

Update documentation

2019-08-30

JC

Added documentation

2019-05-15

LC

Update options available

2017-09-05

LC

UPDATE BUG IN URL