Field assignment

Hello,
How to make the assignment fields (user and team);
1- required
2- filled in automatically, depending on the logged in user?

Example:

  • User 1 is connected
  • User 1 belongs to Team A

when creating a contract the following fields must be filled:

  • Assigned *: User 1
  • Team *: A

Infos: SuiteCRM 7.1.5

Field level functionality cannot be achieved with the out of the box security suite that comes with SuiteCRM.

You would need to develop custom functionality.

Thanks,

Will.

Starting with the first part of the problem:
How to make the selection of the user and the team required when entering?

In order to make ‘assigned_to’ required you need to create a new manifest file under /www/custom/Extension/modules/your_module_name/Ext/Vardefs/sugarfield_assigned_to.php


<?php
$dictionary['OP14_op']['fields']['assigned_user_name']['required'] =true;
$dictionary['OP14_op']['fields']['assigned_user_id']['required'] =true;
?>

Then make a quick repair and it’s done

It did not work for me :frowning:

Sorry dpccrt87, I was wrong in the code, this is the correct one

<?php
$dictionary['your_module_name']['fields']['assigned_user_name']['required'] =true;
$dictionary['your_module_name']['fields']['assigned_user_id']['required'] =true;
?>

I put my module name, forgot to remove it, now it should work with your module name

Best Regards

1 Like

it’s good, it works, thank you very much, :slight_smile:
But now, I would like to know how to capture departement, and binding suppliers??

For that you need to go to /var/www/custom/Extension/modules/your_module/Ext/Vardefs

and Edit the relationshipt that corresponds to the fields you want to make required and then you need to add ‘required’ => true, in the name relation like this example

$dictionary["your_module"]["fields"]["accounts_your_module_name"] = array (
  'name' => 'accounts_your_module_name',
  'type' => 'relate',
  'required' => true,
  'source' => 'non-db',
  'vname' => 'LBL_ACCOUNTS_YOUR_MODULE_FROM_ACCOUNTS_TITLE',
  'save' => true,
  'id_name' => 'accounts_your_module_IDA',
  'link' => 'accounts_your_module',
  'table' => 'accounts',
  'module' => 'Accounts',
  'rname' => 'name',
);

Always run quick repair after

Best Regards

2 Likes