How to make a dependent field based on user assigned to record

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.

Parents Reply
  • 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!

Children
  • 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")',
      ),
      ),
      ),
      );
    
  • Hi Paul Deakin,

    Below is the formula that I used to achieve this.

    equal(related($assigned_user_link,"user_name"),"chris")

    In my instance I used Chris as my test User. Although you do not see an option for User Name when selecting the related field in formula builder, I simply chose the First Name option and then changed it manually in the formula from "first_name" to "user_name". The two images below show this working, with the field that becomes visible being called "Test" and on the bottom row of fields to the right of the "Test User" image (please ignore the funny field names, this is my test system).

    Image 1 - Account Assigned To Jen

    image_1.png

    Image 2 - Account Assigned To Chris

    image_2.png