Original Template VAF Script

Hi,

I'm using the "maintaining the original object template" script from here: https://developer.m-files.com/Samples-And-Libraries/Samples/Processes/Maintaining-Original-Template/

While the script is working, the problem I have is that if I make the property read only then it doesn't get copied to new objects created from the template. This means that I have to leave the property as writeable by everybody, and then users can change this value which means it doesn't achieve the goal of permanently maintaining the original template.

I understand that the metadata card can hide properties, but this isn't the same as making the property read only. Is there anyway to make this property propagate from the template to new objects but prevent anybody modifying it afterwards?

Parents
  • Could you alter the property and not allow anyone (i.e. only admins) to edit the value?  I haven't tried that in context of this code, but that'd be my starting point.

  • So that’s what I tried originally, but the surprising thing I found is when I did that the property didn’t get added to a new object I created from a template. I really wasn’t expecting that behaviour, but I’m guessing it was a matter of “you don’t have access to this property, so it won’t be set on the object you create”?

  • Interesting. Did you allow users to read the value?

    If that doesn't work then hiding it via metadata card configuration rules if the only other option I can think of. 

  • Tried a few different iterations of this - it seems like properties from templates are only applied to new objects if the person creating the new object has write access to the property.

    I tried:

    • making the property visible but not editable, and adding the property permanently to the class being created. The property in this case would be on the new object, but it would stay blank
    • making the property visible but not editable, and NOT adding the property to the class - in this case the property did not get added to the new object at all
    • make the property editable by users - in this case the property DOES end up on the new object (regardless of whether the property is already attached to the class) - but it prevents me applying access controls (metadata card configuration being the only option, but then people can't SEE what the original template was)

    Is it possible to get a feature request in that new objects should be able to inherit properties from templates even if the user creating the object does not have write access / visibility of the property?

Reply
  • Tried a few different iterations of this - it seems like properties from templates are only applied to new objects if the person creating the new object has write access to the property.

    I tried:

    • making the property visible but not editable, and adding the property permanently to the class being created. The property in this case would be on the new object, but it would stay blank
    • making the property visible but not editable, and NOT adding the property to the class - in this case the property did not get added to the new object at all
    • make the property editable by users - in this case the property DOES end up on the new object (regardless of whether the property is already attached to the class) - but it prevents me applying access controls (metadata card configuration being the only option, but then people can't SEE what the original template was)

    Is it possible to get a feature request in that new objects should be able to inherit properties from templates even if the user creating the object does not have write access / visibility of the property?

Children
No Data