Epicor添加明细提示报错


外部使用SDK新增单据的时候,按照浏览器端的抓包逻辑新增,主表没问题,到添加明细的时候就报错了。报错信息如下:

Markup 全选
System.Data.ConstraintException
  HResult=0x8013192A
  Message=Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Table: JobProd
Company='901' JobNum='002605' PartNum='W550300003' OrderNum='0' OrderLine='0' OrderRelNum='0' WarehouseCode='' TargetJobNum='' TargetAssemblySeq='0' TargetMtlSeq='0' AttributeSetID='0' SysRowID='00000000-0000-0000-0000-000000000000': 
ForeignKeyConstraint PartProd requires the child key values (901, 002605, W550300003, 0) to exist in the parent table.
  Source=Epicor.ServiceModel
  StackTrace:
   在 Ice.DatasetAdapter.CopyTSTableToDataTable[TIceRow,TDataTable](IceTable`1 sourceTSTable, TDataTable destinationTable)
   在 Ice.DatasetAdapter.Copy(IceTableset sourceTableset, DataSet destinationDataset)
   在 Ice.Cloud.RpcSerializer.DeserializeDataSetFromTableset(Type tablesetType, Object initialValue, Boolean useSparseCopy, Stream stream)
   在 Ice.Cloud.RestRpcValueSerializer.Deserialize(ProxyValueOutInfo valueOut, Boolean isMethodReturn, Stream stream)
   在 Ice.Cloud.RestRpcValueSerializer.Deserialize(ProxyValuesOut valuesOut, Stream stream)
   在 Epicor.ServiceModel.Channels.ImplBase.DeserializeContent(RestRpcValueSerializer serializer, ProxyValuesOut valuesOut, HttpContent content)
   在 Epicor.ServiceModel.Channels.ImplBase.CallWithMultistepBpmHandling(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
   在 Epicor.ServiceModel.Channels.ImplBase.Call(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
   在 Erp.Proxy.BO.JobEntryImpl.GetNewJobProd(JobEntryDataSet ds, String jobNum, String partNum, Int32 orderNum, Int32 orderLine, Int32 orderRelNum, String warehouseCode, String targetJobNum, Int32 targetAssemblySeq, Int32 targetMtlSeq)
   在 EpicorProvider.Controllers.JobController.<BatchImport>d__11.MoveNext() 在 D:\Project\epicorprovider\EpicorProvider\Controllers\JobController.cs 中: 第 951 行

  此异常最初是在此调用堆栈中引发的: 
    System.Data.DataSet.FailedEnableConstraints()
    System.Data.DataSet.EnableConstraints()
    System.Data.DataSet.EnforceConstraints.set(bool)
    System.Data.DataTable.EndLoadData()
    Ice.DatasetAdapter.CopyTSTableToDataTable<TIceRow, TDataTable>(Ice.IceTable<TIceRow>, TDataTable)

内部异常 1:
ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

解决方案

有时候是新增了主表后。新增明细前需要调用一下获取数据接口(浏览器端的刷新数据按钮)。有些是GetByID,有些是GetDatasetForTree等。以浏览器为准。。

然后拿获取的数据再去新增明细。就可以啦。。

 

 

 

 

 

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
张国生
上一篇:Epicor导入并解析excel
下一篇:没有了
评论列表

发表评论

评论内容
昵称:
关联文章

Epicor添加明细提示
Epicor删除收藏夹
VS .NET使用EF添加实体数据模型向导添加连接
Epicor客户端安装
EFCore异步查询
插入代码页面
.NET Core Winform 打开窗体设计器
EFCore链接数据库
EF异步查询ToListAsync
Epicor安装步骤
PC端编译 Empty block statement no-empty
C#HTTP请求RestSharp.RestClient发起https请求
.NETCore 运行项目:Could not load file or assembly ***
EF 分页 SQL2008 Featch Next
asp.net core MVC路由添加.html伪静态url时报
使用队列(ConcurrentQueue)时获取队列运行
WCF中常见的:The content type text
vue typescript 使用big.js编译build会
阿里云搭建FTP服务器访问 200,227错误
Python多线程中试用wmi

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码