Is there any way to make a field in a module dependent on whether a specific user is assigned to the record?
E.g. if 'John Smith' is assigned to the record then text field 'ABC' appears.
Is there any way to make a field in a module dependent on whether a specific user is assigned to the record?
E.g. if 'John Smith' is assigned to the record then text field 'ABC' appears.
Hi Paul,
I hope this you can do through dependency,You can go with "SetVisibility" dependency for a field. Here is the sugar documentation on sugar dependency,Please have a look,
Hi Paul Deakin,
You can perform this using a standard SugarLogic dependency on the TextField itself, rather than using the development option provided by Ajay Kumar. I performed this on a test system by simply using the "equal" function and getting the related Assigned to User (I used their user_name). You can then specify the User you want it to work for, or a list if you preferred to do it that way.
Hope that helps.
Hi Liam Hastings,
I've tried using basic functions such as "equal" and "isInList" but I'm just having no luck making it work so far. I'm essentially trying to get a new TextField to appear when a specific user is assigned to that record, but I'm unable to use the 'user_name' field (as the formula does not recognise this as a field) and using the 'assigned_user_link' field and then the name of the user just results in nothing happening when I've tried a test record.
I'm sure there is something very simple I'm missing but I can't work out what it is for the life of me!
*Just to clarify, I'm trying to get the new field to be created for an Opportunity when a new Opportunity is assigned to a specific user
Thank you for the swift response - any further help would be greatly appreciated!
You have to check your value with field "assigned_user_name" instead field "user_name" . Here is sample code for making visible field "phone_mobile" for leads module.When assigned user is "Ajay Kumar",then phone_mobile field will be visible,otherwise it will be hidden.
$dependencies['Leads']['test_visibility_assigned_user']=array( 'hooks'=>array("edit"), 'trigger'=>'true', 'triggerFields'=>array('assigned_user_name'), 'onload'=>true, 'actions'=>array( array( 'name'=>'SetVisibility', 'params'=>array( 'target'=>'phone_mobile', 'label'=>'phone_mobile_label', 'value'=>'equal($assigned_user_name,"Ajay Kumar")', ), ), ), );
You have to check your value with field "assigned_user_name" instead field "user_name" . Here is sample code for making visible field "phone_mobile" for leads module.When assigned user is "Ajay Kumar",then phone_mobile field will be visible,otherwise it will be hidden.
$dependencies['Leads']['test_visibility_assigned_user']=array( 'hooks'=>array("edit"), 'trigger'=>'true', 'triggerFields'=>array('assigned_user_name'), 'onload'=>true, 'actions'=>array( array( 'name'=>'SetVisibility', 'params'=>array( 'target'=>'phone_mobile', 'label'=>'phone_mobile_label', 'value'=>'equal($assigned_user_name,"Ajay Kumar")', ), ), ), );