Question as per title in Sugar 7.6
Question as per title in Sugar 7.6
What do you mean by 'set role'? Do you mean get the role?
You can get the role of a user in a logic hook using:
$rolesArray = ACLRole::getUserRoleNames($current_user->id);
Alternatively ACLRole::getUserRoles($current_user->id);
If you want to set the role, why would you want to set the role in a relationship logic hook? What are you trying to achieve?
Thanks Alan!
I though there might be a way to achieve the same using the Bean instead of direct db query but thanks anyway!
Glad you liked the answer. It is probably $bean->opportunities_contacts->contact_role = 'Executive Sponsor'. But sometimes life is too short to use the bean. ;-)
Glad you liked the answer. It is probably $bean->opportunities_contacts->contact_role = 'Executive Sponsor'. But sometimes life is too short to use the bean. ;-)