workflow create task - unable to relate to Account

Version 7.10.11

workflow module - contracts

action - create record - task

add relationship - account - field - account

by right when the task is created, it should be related the account of the selected contract.

but in the “related to” column in task list view, it shows the contract name.

Have you tried using the “account id” field in the relationship instead?

Yes I did, I’ve also tried “ID” and also “value” - specify the exact account name from the pop up selection box.

None of above works.

I think the problem is that you are in a Contracts workflow, not in an Accounts Workflow, so there is no Account id there.

You can make it

  • create an a new task and link it to the current Contract

but it’s not smart enough to

  • create an a new task and link it to the Account to which the current Contract belongs

Can you code some basic PHP? You could do this from an after_save logic hook. See the Developer Guide.

https://docs.suitecrm.com/developer/logic-hooks/

but I found it is interesting that it works if I do :

Contracts Workflow

Create Task - Add Field - Task Title - Account, it will set the task title to the account name

Create Task - Add Field - Description - Account, it will set the Description field to the account name

So I guess it is able to get Account Name, but it just unable to set the relationship.

Yes it is possible that it uses better logic when fetching the related data for a field, but not for the relationship. if you are a developer, or have one in your company, I suggest you get him/her to look at the code doing this in one case, and copy it (adapt it) to the other case, and then contribute this enhancement to the Community! :slight_smile: