"Apply Template" related link for projects, need help to understand whole logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 02:30 AM
So, I see Apply Template related link on project form but sometimes it doesn't show.
I see that the UI action doesn't have any version so it is OOB.
So, 1. what is the logic when to show and when not to show?
My understanding: It shows only when there are child tasks to a project. Any business case explanation for that?
2. How to know if a templated has already been applied to a project or not?
3. My requirement is that if a templated is applied then the apply template related link should be removed/hidden but that is not the case, any explanation why it is built like that? Why we can apply templates again and again.
Please share your knowledge, Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 02:48 AM
Hi @Chandler2 ,
The "Save as Template" UI Action has a condition on it as follows:
!current.isNewRecord() && gs.hasRole('project_manager') && ((new ProjectWorkbenchService().hasChildren(current.sys_id)))
So, the Project cannot be New (has to have been previously saved), the user must have the Project Manager role (which you'd have as 'admin'), and the Project needs to be underneath the Project Workbench Service (you can probably safely ignore this).
If you believe all of those conditions are being fulfilled, then I'd check out the UI Action "Save as Template" in your instance to make sure it hasn't been modified to have additional conditions.
FYI, it is also not visible when on the Planning Console, so make sure you've gone to Projects > All and then selected the Project you want to save as a template.
because of UI Action "((new ProjectWorkbenchService().hasChildren(current.sys_id)))" create a New Template option doesn't appear in the related links unless the project you're trying to create the template from has Project Tasks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 04:28 AM
Hello,
I am not asking about Save as template. I asked about Apply Template.
It is my humble request that please read the question before you answer as it is a common observation that a post with no answer has more chances of being noticed than a post with some answers.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2023 01:04 PM
Templates are hierarchical representation of Project Tasks, they define the parent child relationships of the tasks. Apply template link only appears when a project does not has any related project tasks (no matter if they are coming from a template or manually created).
The logic behind this restriction is that once a project has a task, it means you have defines what order the project tasks should trigger and schedule is based on them.
If you allow multiple templates, system wont know how to connect these projects tasks as there are multiple hierarchies instead of one to the project.
My suggestion, when you create templates , create them like in a way that particular type of projects (for e.g. if you are in a health industry and you get projects to build hospitals, your templates for all growth and construction projects can use that templates). This way , 1 template is sufficient for a project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2023 12:59 AM
I don't think this is correct " Apply template link only appears when a project does not has any related project tasks (no matter if they are coming from a template or manually created)." as I see Apply Template on the projects where there are project tasks.
Also, how do I know if the project has a template applied or not?