11-03-2016 09:39 AM
I am receiving the following error when trying to add a contact to an opportunity...
The INSERT statement conflicted with the FOREIGN KEY constraint "CONTACT_OPPORTUNITY_OPPORTUNITYID_FK". The conflict occurred in database "database name", table "dbo.TBL_OPPORTUNITY", column 'OPORTUNITYID'. The statement has been terminated.
Any ideas on what caused this error and how to fix?
11-03-2016 09:54 AM
Have you tried using a different name in the Opportunity name field?
11-03-2016 10:25 AM
I just tried and it did not work.
This is happening when I try to create a new opportunity. This is probably part of the same error but it is not automatically adding a contact to the new opp when it is first created like it usually does. I get the error above when I go to add a Contact.
11-03-2016 10:25 AM
11-03-2016 10:36 AM
None of our field names have a lock icon and it seems to be affecting all users so I am not sure if this is it.
11-03-2016 11:02 AM
I suggest using the Tools - Maintenance - Check and repair.
If that does not work look at how to use ACTDIAG to rebuild the database - link below on how to run and use ACTDIAG. (It is already installed on your machine.)
11-03-2016 11:17 AM
Thanks for all of the answers but the Check and Repair didn't work either. This will be the fourth time since April we have had to rebuild the database because of various issues with ACT. This means we also have to reload all of our remote users also. I'm afraid it is about time for our company to move on from ACT.
11-04-2016 10:00 AM
Can you make sure that you have not inadvertently named a field the same as one of the system fields or renamed a system field. Oddly ACT sometimes lets you do this and then it starts to cause problems. EG rename the Contact field to Client and then create a new Contact field.
11-04-2016 10:09 AM
@ch1p wrote:Can you make sure that you have not inadvertently named a field the same as one of the system fields or renamed a system field. Oddly ACT sometimes lets you do this and then it starts to cause problems. EG rename the Contact field to Client and then create a new Contact field.
Interesting ch1p. I don't think any of our administrators would do this but I will take a look at the fields. Any idea what to do if a system field has been renamed? I am guessing/hoping I can just delete a field with the same name.
11-05-2016 03:43 AM
It will not allow a duplicate field name in the same table so it only if a field that ACT uses is renamed and then a new one created with the old name. This can be caused if some of the fields that appear in the lookup list are renamed and then a new field with the old name is created. The effects are odd and often do appear until trying to sync or make a backup but can also cause random issues and errors.
Use the field reports in ACTDIAG to see if fields have been renamed and new ones added.