Post

4 followers Follow
0
Avatar

validation rule to prevent override of template

 

I am wanting to write a validation rule to prevent existing templates being over-ridden. This is proving extremely difficult. So far I have written one on the project level:

IsTriggeredBy('NewTemplate') && Not(IsNew(CurrentObject()))

This works when you have a saved project, and you try to override an existing template. The issue however, is that is also stops a new template being created from an existing project.

How do I only allow the override to blocked? I can't seem to make any custom actions on a template object, but you can see them in the objects list. I'm not even sure what type of object they are?

Rick Entress Answered

Please sign in to leave a comment.

7 comments

0
Avatar

Would it work if you kept the restriction as it is and then opened up the permissions to allow a certain group (Admin for example) to bypass the restriction.

That would mean that members of the group could create and overwrite templates, but all other users would not be able to.  If a user, would like to have a new template, they can then request for a specific project plan to be made a template by a member of the group.

Phil Smith 0 votes
Comment actions Permalink
0
Avatar

Hello Rick,

 

Is the behaviour seen in the following video what you're after? https://www.screencast.com/t/3m4gdrg1 

If so, please create a validation rule on Project >> set "Set Run Time" setting to "Every time a record is deleted" >> set "Set Evaluation Criteria"

 to IsTriggeredBy("NewTemplate") >> set "Set Error Message" to whatever you like >> Save and Enable the Validation Rule.

 

Please let me know if this is helpful.

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

@PaulSmith - not really, as that wouldn't solve the issue of wanting to allow people to create, but not edit. 

Rick Entress 0 votes
Comment actions Permalink
0
Avatar

Yes, that's what I want, thank you Roland.

On the topic of the Templates - they are very useful, and yet the functionality is super duper bare bones. What we'd really like:

 

1. Ability to preview the template to see it's composition. With many templates you are just left guessing.

2. Ability to lock certain templates, not just all of them like this validation rule.

 

Rick Entress 0 votes
Comment actions Permalink
0
Avatar

1.) This would have to be submitted as a feature request. 

2.) You can add additional criteria to the validation rule so that only admins or specific people can over-write templates.

Josh Santos 0 votes
Comment actions Permalink