Community
Showing results for 
Search instead for 
Do you mean 
Reply

Error when trying to add a Contact to an Opportunity

New Member
Posts: 5
Country: USA

Error when trying to add a Contact to an Opportunity

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?

 

 

Bronze Elite Contributor
Posts: 1,430
Country: United_Kingdom

Re: Error when trying to add a Contact to an Opportunity

Have you tried using a different name in the Opportunity name field?

New Member
Posts: 5
Country: USA

Re: Error when trying to add a Contact to an Opportunity

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. 

Copper Contributor
Posts: 15
Country: India

Re: Error when trying to add a Contact to an Opportunity

Try This:
1.Select Opportunities
2.Click the Tools menu
3.Select Define Fields
4.Select the Field Name with a lock icon
5.Click on Field Security
6.Select the user with an issue and click Reset
Click Finish
New Member
Posts: 5
Country: USA

Re: Error when trying to add a Contact to an Opportunity

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.

 

Bronze Elite Contributor
Posts: 1,430
Country: United_Kingdom

Re: Error when trying to add a Contact to an Opportunity

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.)

 

http://kb.act.com/app/answers/detail/a_id/11984/~/how-to-use-the-act!-data-diagnostic-tool-(actdiag)....

New Member
Posts: 5
Country: USA

Re: Error when trying to add a Contact to an Opportunity

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.

Bronze Elite Contributor
Posts: 1,430
Country: United_Kingdom

Re: Error when trying to add a Contact to an Opportunity

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.

New Member
Posts: 5
Country: USA

Re: Error when trying to add a Contact to an Opportunity


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.

Bronze Elite Contributor
Posts: 1,430
Country: United_Kingdom

Re: Error when trying to add a Contact to an Opportunity

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.