spMFCreateAllLookups

Signature

EXEC dbo.spMFCreateAllLookups
    @ProcessBatch_ID = NULL OUTPUT,
    @Schema = N'dbo',
    @IncludeInApp = 1,
    @WithMetadataSync = 0,
    @Debug = 0;
Returns
  • 1 = Success

  • -1 = Error

Parameters
@ProcessBatch_ID int (optional, output)

Referencing the ID of the ProcessBatch logging table

@Schema nvarchar(20)
  • Default = ‘dbo’

  • Which schema to operate on

@IncludeInApp int (optional)
  • Default = 1

  • Accepted but not used: the procedure includes the class tables of every class whose MFClass.IncludeInApp is not NULL, whatever this value is

@WithMetadataSync bit (optional)
  • Default = 0

  • 1 = call spMFDropAndUpdateMetadata internally

@Debug smallint (optional)
  • Default = 0

  • 1 = Standard Debug Mode

  • 101 = Advanced Debug Mode

Purpose

Prodecedure to create all workflow and Valuelist lookups that is used in the included in App class tables

Run it after the class tables exist (for example after spMFCreateAllMFTables): it looks only at columns that are present in the class tables. For the class tables of all classes with an IncludeInApp value, it takes the single- and multi-lookup columns of properties with an M-Files ID above 1000, and creates:

Special characters in the value list or workflow name are replaced in the view name. A view that already exists with that name is not changed. Views with other names, such as the MFvwValueList_<name> or MFvwWorkflowStates views found in some older databases, are not created or changed by this procedure. To create a single view, or a view with a name of your choice, call spMFCreateValueListLookupView or spMFCreateWorkflowStateLookupView directly.

Changelog

Date

Author

Description

2026-11-16

AC

Document the views created, their names and the @IncludeInApp behavior

2019-08-30

JC

Added documentation

2019-01-30

LC

Valuelist name: Source Does not exist or is a duplicate