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.

Parents
  • 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:

  • 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. 

Reply Children
No Data