Hi Team,
I am fairly new to EspoCRM. I am trying to implement the following to restrict access to users.
When I create an account, I want to create a Team with the same name (which i am able to do). But once the team is created, I want to link the Account and Team. This is where I am having trouble. Below is the formula script I've written under "Update Target Record".
I am fairly new to EspoCRM. I am trying to implement the following to restrict access to users.
When I create an account, I want to create a Team with the same name (which i am able to do). But once the team is created, I want to link the Account and Team. This is where I am having trouble. Below is the formula script I've written under "Update Target Record".
PHP Code:
$team = record\findOne('Team', 'createdAt', 'desc', 'name=', name);
$id = '';
if ($team) {
$teamId = object\get($team, 'id');
record\create('EntityTeam', 'entityId', id, 'teamId', $teamId, 'entityType', 'Account')
}
Comment