This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Network Connector File Creation & Customized Numbering (lettering)

A few things that have been requested of me as we continue to move departments over to M-Files, which I have not been able to solve myself.

One might be difficult the other shouldn't be too bad.

The first (which might be hard if not impossible) is to create files in M-Files and have them point to a network location using the Network Folder Connector. I've played around with workflows to see if you can the location of the network folder and have the properties set using the inbuilt property definitions for "Location" and "Repository". I can get the value of the Repository through the property value, but can't seem to set the object being created's property to that folder. Is this even possible to do?

Also, I'm trying to get an autonumbering for objects, but using VBA rather than the custom automatic numbering. Is there a simply way to count the number of subtypes of a specific object that have been created, and create numbering based on that?

So let's say we have an 'Address' (alias OT.Job) and a 'Project' object (OT.Project); OT.Project is a subtype of Ot.Job.

Ot.Job objects are named '19-xxxx' and their associated project subtypes are named 19-xxxx-A, 19-xxxx-B etc..

What I want to do, is have an 'A', 'B' etc.. numbering whenever a 'Project' object is created. How I want this to work is that the trailing letter as above is based on how many subtypes of a specific object are created. I am attempting to do this by counting the amount of projects have been already created under a specific owner (so if the count is 0, the character is A, if the count is 1, the caracter is B and so on). I assume this would be done via a search and then counting the results, but everything I have tried comes back as 0.


Dim oSc : Set oSc = CreateObject("MFilesAPI.SearchCondition")
Dim oScs : Set oScs = CreateObject("MFilesAPI.SearchConditions")

oSc.Expression.SetValueListItemExpression MFValueListItemPropertyDefOwner, MFParentChildBehaviorNone, Nothing
oSc.ConditionType = MFConditionTypeEqual
oSc.TypedValue.SetValue MFDatatypeLookup, 1
oScs.Add -1, oSc

Set oResults = Vault.ValueListItemOperations.SearchForValueListItemsEx(153, oScs, False, MFExternalDBRefreshTypeNone)

err.raise mfscriptcancel, oResults.count

output = oResults.count


This is what I have tried, and a bunch of others, to no avil. the list '153'above is the project object list.
  • To your first question: this is not yet supported. Network Folder Connector (as well as other IML connectors) currently only allows you to access and manage files which are already on the network share. Documents which are created in M-Files are always stored in M-Files. We have several IML-related improvements on the roadmap including external object migration ie. ability to physically move files between M-Files and other repositories, however I don't have any confirmed details on exactly which use cases will be supported and when.

    To your second question, have a look at the sequences functionality in Compliance Kit's Utilities module and see if that could be configured to fulfill your requirements. This module is part of the free Configuration Accelerators add-on and delivered in the Compliance Kit vault application which you can download from the Solution Catalog if you are not using CK already.
  • Hi Joonas, thanks for your answers to both my questions. I'll await future updates regarding this, but in the interim, we'll use the legacy external file sources to perform this task.

    We've got the CK installed but seldom use it. I've read the manuals and looked at the demo criteria, and can't find a way to actually implement this, although it does look promising.

    Would summing up the contents in child list under a specific parent be that hard with VBA?
  • Probably not but I would personally avoid custom scripting whenever there is a way to achieve the same result via configuration. Makes the vault easier to manage, removes the need for script validation in cloud vaults etc.