7.2 Account Required when importing Opportunities while not required in manual entry

I have in my config file accounts required turned off. I have a B2C business, Accounts are not required

I am trying to import a file of opportunities from a previous version of SuiteCRM into a fresh install of 7.2.

When I look in studio:
— Opportunities:Fields, there is no Account field.
— Relationships, there is the standard Many to Many relationship for accounts_opportunities

If I were to manually create an opportunity, there is an ‘Account’ field, with the ability to open the pop-up window and select an existing Account.
— I can create an opportunity manually without an account associated with the record with no issues at all.

The import file and the mapping has an ‘Account’ field. Most of my opportunities do NOT have an account field, as the opportunity was with a Contact (a consumer)

When I try to import a file of opportunities, the mapping says the Account field is REQUIRED.
My opportunities fail because they do not have an account associated with them.

I noticed that this is the case with the prior version as well, but I did not have to important opportunities in that incidence as they were manually entered.

Can anyone suggest a way of turning this requirement off?

Also, I put this under a ‘bug’ as I believe if Accounts as a requirement is turned off in the config file, it should turn the requirement off in the opportunities import process.

sounds like you need to override the vardef for that file. by default this field is required by the user which you have turned off. and also required when importing. so whtin the vardef for this file it looks li
‘account_name’ =>
array (
‘name’ => ‘account_name’,
‘rname’ => ‘name’,
‘id_name’ => ‘account_id’,
‘vname’ => ‘LBL_ACCOUNT_NAME’,
‘type’ => ‘relate’,
‘table’ => ‘accounts’,
‘join_name’=>‘accounts’,
‘isnull’ => ‘true’,
‘module’ => ‘Accounts’,
‘dbType’ => ‘varchar’,
‘link’=>‘accounts’,
‘len’ => ‘255’,
‘source’=>‘non-db’,
‘unified_search’ => true,
‘required’ => true,
‘importable’ => ‘required’,
‘required’ => true,
),

you need to override the importable option create a php file and name it something.

/var/www/html/SuiteCRM/custom/Extension/modules/Opportunities/Ext/Vardefs/file.php

and add

<?php $dictionary['Opportunity']['fields']['account_name']['importable'] = false; do a repair and rebuild and that should fix this. Ian.
2 Likes