# Single User receiving error

**URL:** <https://www.epiusers.help/t/single-user-receiving-error/108058>\
**Category:** Kinetic ERP\
**Tags:** customization, epicor\
**Created:** [October 16, 2023, 6:42pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058 "2023-10-16T18:42:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasond](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jasond](https://www.epiusers.help/u/jasond)\
**Post date:** [October 16, 2023, 6:42pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/1 "2023-10-16T18:42:18Z")

</div>

We have a custom built interface for data entry using one of the UD tables. We have not had any issue with anything until today when one user started receiving the error:

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Table: ShipToSrch

This isn’t showing up for any other user. I even went as far as to create a new user that mirrored the “trouble user” exactly and it didn’t receive the error. I’m at a loss here.

---

<div class="post-metadata">

**Author:** ![utaylor](https://www.epiusers.help/user_avatar/www.epiusers.help/utaylor/32/64664_2.png) [@utaylor](https://www.epiusers.help/u/utaylor)\
**Post date:** [October 16, 2023, 6:43pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/2 "2023-10-16T18:43:17Z")

</div>

pretty sure @Ross.Fireball.Kuiper had this same thing?? Maybe?

---

<div class="post-metadata">

**Author:** ![Ross.Fireball.Kuiper](https://www.epiusers.help/user_avatar/www.epiusers.help/ross.fireball.kuiper/32/51185_2.png) [@Ross.Fireball.Kuiper](https://www.epiusers.help/u/Ross.Fireball.Kuiper)\
**Post date:** [October 16, 2023, 6:44pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/3 "2023-10-16T18:44:58Z")

</div>

Doesn’t sound familiar unfortunately…

---

<div class="post-metadata">

**Author:** ![utaylor](https://www.epiusers.help/user_avatar/www.epiusers.help/utaylor/32/64664_2.png) [@utaylor](https://www.epiusers.help/u/utaylor)\
**Post date:** [October 16, 2023, 6:46pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/4 "2023-10-16T18:46:32Z")

</div>

I thought this was similar [Part screen strange error - ERP 10 - Epicor User Help Forum (epiusers.help)](https://www.epiusers.help/t/part-screen-strange-error/106192/28)

But it’s not!

---

<div class="post-metadata">

**Author:** ![jasond](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jasond](https://www.epiusers.help/u/jasond)\
**Post date:** [October 16, 2023, 7:13pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/5 "2023-10-16T19:13:33Z")

</div>

Not sure it will help but here is the full error:

Application Error

Exception caught in: Epicor.ServiceModel

# Error Detail

Message: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Table: ShipToSrch  
SysRowID=‘ff3e9788-8ebe-478e-aea3-d63876d1d8fd’: ForeignKeyConstraint CustomerToShipToSrch requires the child key values (BWF, 107) to exist in the parent table.  
Inner Exception Message: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.  
Program: Epicor.ServiceModel.dll  
Method: CopyTSTableToDataTable

# Client Stack Trace

at Ice.DatasetAdapter.CopyTSTableToDataTable[TIceRow,TDataTable](IceTable`1 sourceTSTable, TDataTable destinationTable)  
at lambda\_method(Closure , IIceTable , DataTable )  
at Ice.DatasetAdapter.Copy(IceTableset sourceTableset, DataSet destinationDataset)  
at Erp.Proxy.BO.CustomerImpl.GetRows(String whereClauseCustomer, String whereClauseCustomerAttch, String whereClauseCustomCrdPool, String whereClausePartner, String whereClauseCustBillTo, String whereClauseCustBank, String whereClauseCustChild, String whereClauseCustDfltDocType, String whereClauseCustIC, String whereClauseCustLabExpRate, String whereClauseCustMandate, String whereClauseCustomerDocs, String whereClauseCustRestriction, String whereClauseCustUPSEmail, String whereClauseCustomerDiscPriceLst, String whereClauseCustomerFSPriceList, String whereClauseGlbCustCred, String whereClauseMXCustomerFiscalText, String whereClauseNAMember, String whereClausePECustWhldHist, String whereClauseShipTo, String whereClauseShipToAttch, String whereClauseShipToRestriction, String whereClauseShipToLabExpRate, String whereClauseCustomerDocsSH, String whereClauseShipToDiscPriceLst, String whereClauseShipToMFBill, String whereClauseShipToPriceLst, String whereClauseShipToUPSEml, String whereClauseCustMFBill, String whereClauseMangCust, String whereClauseShipToSrch, String whereClauseCustomerPriceLst, String whereClauseEntityGLC, String whereClauseTaxExempt, Int32 pageSize, Int32 absolutePage, Boolean& morePages)  
at Erp.Adapters.CustomerAdapter.OnGetRows(SearchOptions opts, Boolean& MorePages, String whereClauses)  
at Ice.Lib.Framework.EpiBaseAdapter.GetRows(SearchOptions opts, Boolean& morePages)  
at Ice.Lib.Searches.EpiSearchEngine.GetSearchResultsFromAdapterMethod(SearchOptions opts, SearchDataSetMode sdsMode)  
at Ice.Lib.Searches.EpiSearchEngine.SearchUsingAdapterMethod(SearchOptions options)  
at Ice.Lib.Searches.EpiSearchEngine.SearchIt(SearchOptions options, DataSet& results, Boolean& usedAdapter)  
at Ice.Lib.Searches.EpiSearchEngine.SearchIt(SearchOptions options)  
at Erp.Adapters.CustomerAdapter.InvokeSearch(SearchOptions opts)  
at Script.custCB\_ValueChanged(Object sender, EventArgs args)  
at Infragistics.Win.UltraWinGrid.UltraCombo.OnValueChanged(EventArgs e)  
at Ice.Lib.Framework.EpiUltraCombo.OnValueChanged(EventArgs e)

# Inner Exception

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

at System.Data.DataSet.EnableConstraints()  
at System.Data.DataSet.set\_EnforceConstraints(Boolean value)  
at System.Data.DataTable.EndLoadData()  
at Ice.DatasetAdapter.CopyTSTableToDataTable[TIceRow,TDataTable](IceTable`1 sourceTSTable, TDataTable destinationTable)

---

<div class="post-metadata">

**Author:** ![utaylor](https://www.epiusers.help/user_avatar/www.epiusers.help/utaylor/32/64664_2.png) [@utaylor](https://www.epiusers.help/u/utaylor)\
**Post date:** [October 16, 2023, 7:20pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/6 "2023-10-16T19:20:15Z")

</div>

> [@jasond](#):
>
> SysRowID=‘ff3e9788-8ebe-478e-aea3-d63876d1d8fd’: ForeignKeyConstraint CustomerToShipToSrch requires the child key values (BWF, 107) to exist in the parent table.

This seems to key in on the keys that are missing from whatever table it is.

---

<div class="post-metadata">

**Author:** ![jasond](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jasond](https://www.epiusers.help/u/jasond)\
**Post date:** [October 16, 2023, 7:26pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/7 "2023-10-16T19:26:58Z")

</div>

It’s just very odd that it’s for a solitary user. Also This is the point in the code where the error occurs:

```
		edvUD11.dataView[edvUD11.Row]["Date01"] = DateTime.Today;
		Erp.Adapters.CustomerAdapter CA = new Erp.Adapters.CustomerAdapter(this.oTrans);
		CA.BOConnect();
		SearchOptions optsC = new SearchOptions(SearchMode.AutoSearch);
		optsC.PreLoadSearchFilter = "CustNum = '" + customerComboC1.Value.ToString() + "' "; ;
		optsC.SelectMode = SelectMode.SingleSelect;		
		optsC.DataSetMode = DataSetMode.RowsDataSet;				
		CA.InvokeSearch(optsC);

```

Error occurs right here.

---

<div class="post-metadata">

**Author:** ![utaylor](https://www.epiusers.help/user_avatar/www.epiusers.help/utaylor/32/64664_2.png) [@utaylor](https://www.epiusers.help/u/utaylor)\
**Post date:** [October 16, 2023, 7:39pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/8 "2023-10-16T19:39:01Z")

</div>

I had this happen the other day when doing a BAQ. It was working and running fine for all these other users, but for a certain user it was using a different SQL execution plan and for some reason, her query was filtering different records than the other user and one of the records had a field value that could not be converted into a string or whatever I was casting it to or something like that.

---

<div class="post-metadata">

**Author:** ![Ernie](https://www.epiusers.help/user_avatar/www.epiusers.help/ernie/32/69401_2.png) [@Ernie](https://www.epiusers.help/u/Ernie)\
**Post date:** [October 19, 2023, 6:57pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/9 "2023-10-19T18:57:22Z")

</div>

I had a similar problem at a SaaS client a few months ago, only one user would get the error when entering sales orders. Same ShipToSrch table error. This customer had the order entry screen customized to a fare-thee-well (which I hadn’t written), so I could only turn it back to their internal team. I don’t know if they ever solved it.

In the user’s case, all she ended up having to do was click OK on the error box, refresh the screen, and all was then well.

There was nothing in the customization that I could see that even cared who the user was, so it made no sense to me.

---

<div class="post-metadata">

**Author:** ![eeaquino](https://www.epiusers.help/user_avatar/www.epiusers.help/eeaquino/32/47134_2.png) [@eeaquino](https://www.epiusers.help/u/eeaquino)\
**Post date:** [January 3, 2024, 11:38pm UTC](https://www.epiusers.help/t/single-user-receiving-error/108058/10 "2024-01-03T23:38:46Z")

</div>

I have seen this error popup when the user does not have access to the Territories.

Had to add a workforce item Add the user to Authorized users and Check “View All Territories”

In case it helps somebody.
