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.
