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

Set as name - retaining current names

It's been a while since I've used the "Set as name" function in M-Files and I'm trying to establish how the behaviour will work...

I've got a class which currently has:

  • the "name or title" property
  • a text field property called "Client Title 1"
  • a text field property called "Client Title 2"
  • a text field property called "Client Title 3"
  • a text field property called "Client Title 4"
  • an automatically calculated multiline text field called "Multiline Title" that combines Client Title 1 - 4 with breaks

The reason we keep the 4 separate fields is that this helps us to support integrating the fields into Word in the way we are required to by clients.

What I would like to do is change "Multiline Title" to be the name for the class, but I want to copy the values for "name or title" into "Client Title 1", but ONLY if "Client Title 1" is empty. Is there a quick function that lets me do this or is it a manual update / custom scripting effort?

  • You could configure a rule in Compliance Kit, Managed Properties with filter setting "Multiline Title" is empty.

    It would also be a simple task to create a validation script to copy the value if the "Multiline Title" is empty.

    In either case you will have to activate the calculation by checkout - checkin or by changing a dummy property on all objects. It will not update automatically.

  • Hello,

    you should be able to do this with Compliance kit if you have it.
    Go here: 

    Then you just choose the property "Client Title I", filter when "Client Title I" is empty and set value mode to dynamic with "{name or title}" as the dynamic value. 


    If for some reason you don't have Compliance kit, then you can do this with a script as well, which you would put into the property Client Title I:

    'Property ID Variables

    pClientTitleI = Vault.PropertyDefOperations.GetPropertyDefIDByAlias("pClientTitleI")
    pNameOrTitle = Vault.PropertyDefOperations.GetPropertyDefIDByAlias("pNameOrTitle")

    'if Client Title I is empty, then put Name Or Title into it

    if PropertyValues.SearchForProperty(pClientTitleI).TypedValue.IsNULL then

    output = PropertyValues.SearchForProperty(pNameOrTitle).TypedValue.DisplayValue

    end if

     

    And regarding "Set as name", I would just try to set Multiline Title as name and then click "Update Names" on the task area for your class (left metadata structure panel).

    Best regards,

    Dominik

  • unfortunately we don't have compliance kit...

  • Unfortunately I don't think there are any other reasonable options except scripting or compliance kit.

  • Managed Properties is included in the free of charge Configuration Accelerators package. You can download Compliance Kit and the license key from catalog.m-files.com/.../