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

Multiple Object Creation in M-Files

We are planning to develop a VAF capable of creating two or more distinct objects whenever a single object is created.

There is an application in the M-Files HR Demo Vault called "HR Extended Use Cases". We aim to replicate a similar VAF here for broader customer utilization.

Here's an illustration: We manage 5 different types of objects related to employee data in M-Files. Therefore, we intend to create a VAF that automatically generates all associated objects when an Employee object is created. For example, upon creating an Employee object, it should automatically generate Employee Confidential Data, Employee Protected Data (Private), and Employee Payroll objects. This eliminates the need for users to create these three objects separately; they should be generated automatically upon Employee creation. I have also attached snapshots of these objects for your reference.

Could someone please advise on a solution for this requirement? Do we need to develop a new VAF for this purpose, or are there existing built-in solutions that can achieve this?

Please let me know if additional information is required. Your suggestions will be greatly appreciated.

  • Take a look at the free of charge Compliance Kit configuration accelerators. You may be able to do this with the Object Creator module.

    Another option is to get a license for Extension Kit. It also has a Object Creation module which is easier to use and more versatile. Extension Kit has a number of other tools that are very useful for different purposes.

  • Hi Karl

    Thanks for your prompt respond.

    I attempted using the Object creator, but it doesn't automatically generate the other objects upon creating an Employee. Instead, there's a button in the task pane that needs to be clicked to initiate the creation of these objects. I haven't been successful in accomplishing this using the compliance Kit. Could you please provide more detail and advise where I might be going wrong?

    Regarding the extension Kit, separate subscriptions are required, which the customer currently doesn't want to use. Therefore, could you please suggest an alternative solution, may be VAF?

    I can see that the similar feature is in Use in M-Files Demo HR Vault. After investigating I've found that they have used a VAF application called "HR Extended Use Cases" to achieve that so i might thinking about building a VAF but need some suggestions where to start with.

    Looking forward for your suggestions.

  • If the off-the-shelf solutions like the CK and Extension Kit don't work for you then a VAF is probably the best way forward.  If you're new to the VAF then there are two resources that I'd probably point you at:

  • I see Property Calculator has a Create Object Mode, but can this work without defining the calculated property?

  • It works. Actually rule can only be run in background if calculated property is not defined.

  • M-Files Application Developer

    Hi Craig,

    Thanks for the detail response. 

    I'm interested in developing a VAF and searching for a course titled 'M-Files Application Developer.' However, I haven't been able to find this specific course. Well I have found a course with name "M-Files Application Developer Growth Program", are you referring to this course?

    I am new to VAF development, apart from the course if you have any other recommendations please do share.

  • Hi Craig, 

    I am following that course, I need your help in the following case.

    I have Successfully created new object (AutoCreateObject) by creating an employee.
    Once I am creating an Employee, It creates a new object name as AutoCreateObject, where the name is auto filled by the static string I am passing. 
    Now I want to create an Employee, on the creation I want to create a new object in which Employee(Multi-ValueList) data should be auto-filled  based on the Employee I am creating.
    Here is my current code, in this please recommend me the changes I need to Integrate for Multi-Valuelist type.
     
    [EventHandler(MFEventHandlerType.MFEventHandlerBeforeCheckInChangesFinalize)]
    public void BeforeCheckInChangesFinalize_CreateNewObjects(EventHandlerEnvironment env) 
    {
        Vault vault = env.Vault;
        ObjVerEx obj = env.ObjVerEx;
        
        if (obj.Type!=this.Configuration.Structure.Objects.Employee)
        {
            return;
        }
        
        if (obj.IsFirstVersion)
            {
            MFPropertyValuesBuilder propBuilder = new MFPropertyValuesBuilder(vault)
            .SetClass(this.Configuration.Structure.Classes.AutoCreateClass.ID)
            .Add(this.Configuration.Structure.Properties.Autocreatename.ID, MFDataType.MFDatatypeText, "AutoFillNAme");
    
            ObjVerEx obj1 = new ObjVerEx(vault,
                                            vault.ObjectOperations.CreateNewObjectEx(this.Configuration.Structure.Objects.AutoCreateObject.ID, propBuilder.Values));
        }
    }
  • The MFPropertyValuesBuilder class provides some helper methods to work with property values, but it's simply a wrapper around the M-Files PropertyValues API class so you have the option of simply working directly with the "Values" that it exposes.

    However, MFPropertyValuesBuilder has a "SetLookup" method.  Have you looked at that?

  • Hi Craig,

     I have successfully developed the VAF and it works as expected .Thankyou so much for guiding me to achieve this.