spMFSynchronizeSpecificMetadata

Signature

EXEC dbo.spMFSynchronizeSpecificMetadata
    @Metadata = N'Property',
    @IsUpdate = 0,
    @ItemName = NULL,
    @ProcessBatch_ID = NULL OUTPUT,
    @Debug = 0;

Returns

INT: 1 on success; -1 on error.

Parameters

@Metadata
  • Type: VARCHAR(100)

  • Required: Yes

  • Description: Metadata type (Property, Valuelist, ValuelistItem, Workflow, State, ObjectType, Login, User).

@IsUpdate
  • Type: SMALLINT

  • Required: No (default = 0)

  • Description: When set to 1 updates names from SQL to M-Files.

@ItemName
  • Type: VARCHAR(100)

  • Required: No (default = NULL)

  • Description: For ValuelistItem or Workflow/State scoping (e.g., valuelist or workflow name).

@ProcessBatch_ID
  • Type: INT

  • Required: No (OUTPUT)

  • Description: References the ID of the ProcessBatch logging table.

@Debug
  • Type: SMALLINT

  • Required: No (default = 0)

  • Description: Debug level. - 1 = Standard Debug Mode

Purpose

Procedure will synchronise the metadata for one of the following

  • Properties

  • Valuelist

  • Valuelistitems

  • Workflow

  • States

  • ObjectType

  • LoginAccount

  • UserAccount

Using the @ItemName parameter for the specifying a valuelist name, the valuelists items for a specific valuelist can be updated; similarly, by using the workflow name the workflow states for a specific workflow can be updated

Setting the @IsUpdate parameter to 1 will allow for the updating of the name from SQL to M-Files.

Additional Info

This procedure is particularly useful when a small change was made in the vault that needs to be pulled through.

When changes are made to classes it is very important to perform all the dependent specific synchronizations before doing the class synchronization.

When using the @Metadata parameter, only partial names can be used.
  • use ‘Proper’ for ‘Properties’

  • use ‘Valuelist’ for’Valuelist’

  • use ‘Item’ for’Valuelistitems’

  • use ‘Workflow’ for’Workflow’

  • use ‘Stat’ for’States’

  • use ‘Object’ for’ObjectType’

  • use ‘Login’ for’LoginAccount’

  • use ‘User’ for’UserAccount’

The @Update parameter is used for making a change to the name for the following objects. A separate routine is used to make a change to valuelist items. This update only include changing an existing item and cannot add new rows for these objects.

  • Properties

  • Valuelist

  • Workflow

  • States

  • ObjectType

  • LoginAccount

  • UserAccount

Refer to spMFSynchronizeValueListItemsToMfiles for updating valuelist items

Examples

EXEC dbo.spMFSynchronizeSpecificMetadata 'Class';
EXEC [dbo].[spMFSynchronizeSpecificMetadata]
  @Metadata = 'User', --  ObjectType; Class; Property; Valuelist; ValuelistItem; Workflow; State; User; Login
  @IsUpdate = 0,  -- set to 1 to push updates to M-Files
  @ItemName = NULL , --only application for valuelists, and workflow states by workflow
  @Debug = 0

Only update value list items for a specific valuelist

EXEC [dbo].[spMFSynchronizeSpecificMetadata]
@Metadata = 'Valuelist'     -- to set this for Valuelists
,@ItemName = 'Country'      -- use any valuelist name to update only the valuelist items for the selected item

Review the tables with the metadata

SELECT TOP 100 * FROM [dbo].[MFProperty] as [mp]
SELECT TOP 100 * FROM [dbo].[MFClass] as [mc]
SELECT TOP 100 * FROM [dbo].[MFValueList] as [mvl]
SELECT TOP 100 * FROM [dbo].[MFValueListItems] as [mvli]
SELECT TOP 100 * FROM [dbo].[MFWorkflow] as [mw]
SELECT TOP 100 * FROM [dbo].[MFWorkflowState] as [mws]
SELECT TOP 100 * FROM [dbo].[MFObjectType] as [mot]
SELECT TOP 100 * FROM [dbo].[MFUserAccount] as [mua]
SELECT TOP 100 * FROM [dbo].[MFLoginAccount] as [mla]

Changelog

Date

Author

Description

2024-06-04

LC

Add processbatch_ID in params to allow single process operations

2023-07-30

LC

Improve logging and productivity of procedure

2019-08-30

JC

Added documentation

2016-08-22

LC

Update settings index

2016-09-09

LC

Add login accounts and user accounts

2016-09-09

LC

provide for slight differences in metadata parameter

2016-09-26

DevTeam2

Removed vault settings parameters

2016-12-08

LC

Add update as parameter

2015-04-08

Dev1

Create procedure