Problem when importing Cases

Hi,
I want to import some cases to my SuiteCRM installation, the problem is i don’t want to associate the information to the name account, any idea how can i disable this required field?
Thanks

Hi,

If you generally don’t want the field to be required anymore then you could add a custom vardef to mark the field as non required (unfortunately at the moment this can’t be done via studio for relationship fields).

This requires adding a file at:

custom/Extension/modules/Cases/Ext/Vardefs/CaseAccountRequiredCustomisation.php

with the following contents:


<?php
$dictionary["Case"]["fields"]["account_name"]["required"] = false;

You’ll need to do a Quick Repair and Rebuild from the admin repair section after adding this. Please note when making any changes to SuiteCRM files that doing a backup of the files and database is always a good idea.

If however this is just for the import a workaround could be to create a dummy account and use this id to import and then delete the account.

Thanks,
Jim

Hi,

Another solution is to set
‘require_accounts’ = false in your config.php
However, it will make Account not required in other modules too (this in mainly done for B2C CRM configuration)

1 Like

Thanks for your answers guys.
But unfortunately no one worked :frowning:

Found a solution.
On modules / Cases / vardefs.php
array (
‘name’ => ‘account_name’,
‘rname’ => ‘name’,
‘id_name’ => ‘account_id’,
‘vname’ => ‘LBL_ACCOUNT_NAME’,
‘type’ => ‘relate’,
‘link’=>‘accounts’,
‘table’ => ‘accounts’,
‘join_name’=>‘accounts’,
‘isnull’ => ‘true’,
‘module’ => ‘Accounts’,
‘dbType’ => ‘varchar’,
‘len’ => 100,
‘source’=>‘non-db’,
‘unified_search’ => true,
‘comment’ => ‘The name of the account represented by the account_id field’,
‘required’ => true,
‘importable’ => ‘false’,
Changed the importable to false :wink: