How to get a Workflow to create a Project based on a Project Template

v7.11.12 on Centos 7 with httpd 2.4.6 and php 7.3

1 I’ve created a Project Template with Tasks :

2 Then I created a Workflow :

3 When I trigger the workflow (by editing an Account), a Project is created :

4 But when I click on the Project name, it appears that the template was not used in creating the Project as no Tasks are assigned, neither does the Gantt chart show any tasks :

However I can start a Project manually based on the template :

So, there must be something wrong with the way I define the workflow in step 2, especially the two relationships at the bottom. As a matter of interest, I tried so many combinations of relationships over a period of 5 hours that I’m no fed up with not having any success. Please help.

1 Like

I’m not sure there is code in place to do that - apply a template when the project is being created programatically. Sure, you can fill in the field that stores the name of the template, but my guess is that the code to actually do the application of the template is simply never called, when this is triggered from a Workflow.

Are you ok with PHP? You get more control from a Logic Hook. Although I am not sure how this would be done from PHP either, i am just guessing it might be possible.

Thanks @pgr

From another post Project Templates , I see Andy was the programmer involved in the Projects module. Is he still around? Do you have access to the developers to confirm your suspicions?

No, I’m afraid Andy is not around any more.

It’s the create_project action in the Project templates controller:

The part from this point on

Since it’s coded directly as an action in the view’s controller, I don’t think it’s going to run form the Workflow. But you can try looking for similar code in other parts of SuiteCRM.

The correct thing to do would be to abstract that into a separate function, and call it from both places (view + Workflow)…

Hello @pgr

I have next to no development skill, especially PHP. I’m more of a business power user on Linux and a bit of Python.

However, having said that, I can help myself getting around and understanding coding to some extent. So I’ll be very grateful for some guidance in this regard. This feature is a make or brake for us. If we cannot get this to work then I fear it’s “farewell” SuiteCRM. I’ll do whatever I can possibly manage to get it to work.

Shall I begin with reading up on Logic Hooks or amending the controller?

Thanks so much.

The code is all there to use, but moving it around might prove more complicated than it looks.

If you don’t know how to use a debugger to figure out the code flow when it comes from the Workflow, I wouldn’t advise you to try and do it yourself.

Can you get a small budget for this? Maybe an experienced developer can do it in a few hours.

Hello @pgr

Can you mail me directly with an estimate of hours to achieve this?
Can we place the resulting code back into the open source collection?

Thanks so much.

Hi

I’ll ask a colleague who handles these requests to email you, ok?

EDIT: yes the resulting code should definitely go into core, thanks!

1 Like

This seems like it would be a useful addition . Id like to revisit. Hope it worked out @EugeneP