Hi
I'm getting an exception trying to save an order.
Getting an exception trying to save an order. SQL Error
-
- Posts: 14
- Joined: Fri Oct 30, 2020 10:41 am
-
- Posts: 1382
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Getting an exception trying to save an order. SQL Error
Sorry but we cannot fix this issue in the DevForum. Please contact SoftPro customer support for assistance.
Bob Richards, Senior Software Developer, SoftPro
-
- Posts: 14
- Joined: Fri Oct 30, 2020 10:41 am
Re: Getting an exception trying to save an order. SQL Error
Hi Bob
After further research found that this error is related to the setting of the contact.
The charge in question is a DueFromBuyerSummaryCharge (CDF Page 3, Section K, Line 4) which is being populated.
If I try to set the Contact property of the Charge, it will produce the error message shown on the image, which is as follow
-------------- QUOTE --------------------------
Process exception:Violation of PRIMARY KEY constraint 'PK_Entity'.
Cannot insert duplicate key in object 'pfm.Entity'. The duplicate key value is (-2146907990, -1878422464). Violation of PRIMARY KEY constraint 'PK_CDFCharge'.
Cannot insert duplicate key in object 'pfm.CDFCharge'. The duplicate key value is (-2146907990, -1878422464). Violation of PRIMARY KEY constraint 'PK_Entity'.
Cannot insert duplicate key in object 'pfm.Entity'. The duplicate key value is (-2146907990, -1878422463). Violation of PRIMARY KEY constraint 'PK_CDFChargeCalculation'.
Cannot insert duplicate key in object 'pfm.CDFChargeCalculation'. The duplicate key value is (-2146907990, -1878422463). Violation of PRIMARY KEY constraint 'PK_Entity'.
Cannot insert duplicate key in object 'pfm.Entity'. The duplicate key value is (-2146907990, -1878422462). Violation of PRIMARY KEY constraint 'PK_IndividualStatementContact'.
Cannot insert duplicate key in object 'pfm.IndividualStatementContact'. The duplicate key value is (-2146907990, -1878422462).
The statement has been terminated.
------------------- END QUOTE ------
Here's the code
var Contact = GetContact(); // This will iteract on Order.Contacts and will return a contact with code "P"
Charge.Contact= Contact
Charge is dynamic, representing the charge @ K.04.01
Below a screenshot of the state of the charge before updating.
Again, the exception is thrown when trying to os.ApplyChanges((IOrder)order);
After further research found that this error is related to the setting of the contact.
The charge in question is a DueFromBuyerSummaryCharge (CDF Page 3, Section K, Line 4) which is being populated.
If I try to set the Contact property of the Charge, it will produce the error message shown on the image, which is as follow
-------------- QUOTE --------------------------
Process exception:Violation of PRIMARY KEY constraint 'PK_Entity'.
Cannot insert duplicate key in object 'pfm.Entity'. The duplicate key value is (-2146907990, -1878422464). Violation of PRIMARY KEY constraint 'PK_CDFCharge'.
Cannot insert duplicate key in object 'pfm.CDFCharge'. The duplicate key value is (-2146907990, -1878422464). Violation of PRIMARY KEY constraint 'PK_Entity'.
Cannot insert duplicate key in object 'pfm.Entity'. The duplicate key value is (-2146907990, -1878422463). Violation of PRIMARY KEY constraint 'PK_CDFChargeCalculation'.
Cannot insert duplicate key in object 'pfm.CDFChargeCalculation'. The duplicate key value is (-2146907990, -1878422463). Violation of PRIMARY KEY constraint 'PK_Entity'.
Cannot insert duplicate key in object 'pfm.Entity'. The duplicate key value is (-2146907990, -1878422462). Violation of PRIMARY KEY constraint 'PK_IndividualStatementContact'.
Cannot insert duplicate key in object 'pfm.IndividualStatementContact'. The duplicate key value is (-2146907990, -1878422462).
The statement has been terminated.
------------------- END QUOTE ------
Here's the code
var Contact = GetContact(); // This will iteract on Order.Contacts and will return a contact with code "P"
Charge.Contact= Contact
Charge is dynamic, representing the charge @ K.04.01
Below a screenshot of the state of the charge before updating.
Again, the exception is thrown when trying to os.ApplyChanges((IOrder)order);
-
- Posts: 1382
- Joined: Wed Jan 15, 2014 3:50 pm
- Location: Raleigh, NC
- Contact:
Re: Getting an exception trying to save an order. SQL Error
You will still need to contact SoftPro Customer Support to resolve the underlying issue. Sorry. They will be able to escalate you to a group that can help with the underlying SQL issue.
Bob Richards, Senior Software Developer, SoftPro