Make Related Field a Required Field

Hi

Any suggestions as to how I can make a related field a required field?

Specifically Campaigns in Leads as a way of ensuring that the sales team always include a campaign

You can try this:

Find out the name of the relate field and customize the below for your requirements (I’ll use “campaign_name” as sample):

Create a file in /custom/Extensions/modules/Leads/Ext/Vardefs/ and name it something relevant, e.g. “campaign_name.php” and populate it with the following:

<?php
$dictionary['Leads']['fields']['campaign_name']['required'] = true;

Be sure to save this with appropriate permissions, then run a Repair and Rebuild.

Thanks,

AlxGr

Hi AlxGr,
From studio required option is there,so i check parent_type field is Required,then i go to code from your given path and check one override field is there,so in that field i write the code:-

 $dictionary['Call']['fields']['parent_type']['default_value']='';
 $dictionary['Call']['fields']['parent_type']['required'] = true;

After save this file , quick repair and rebuild but still it not mandatory field.
please help me.

1 Like