调用K3Cloud,连接成功后,调用保存函数client.save("BD_Customer", Json);失败。
返回错误信息如下:
[code]{
"Result": {
"ResponseStatus": {
"ErrorCode": 500,
"IsSuccess": false,
"Errors": [
{
"FieldName": "【字段Key:FT_BD_CUSTLOCATION,字段名:联系人】;实体类型BD_CUSTLOCATION中不存在名为Id的属性",
"Message": " at Kingdee.BOS.WebApi.FormService.MapPropertyService.MapComplexProperty(String pkProperty, Dictionary`2 sourceObj, DynamicObject targetObj, Int32 rowIndex, HashSet`1 NeedUpDateFields)\r\n at Kingdee.BOS.WebApi.FormService.Save.Revole()\r\n at Kingdee.BOS.WebApi.FormService.Save.Execute()\r\n at Kingdee.BOS.WebApi.FormService.BillOperationService.ExecuteOperation(FormOperation op, String data)",
"DIndex": 0
}
],
"SuccessEntitys": [],
"SuccessMessages": [],
"MsgCode": 0
}
}
}[/code]
代码如下:
[code]BDCustomer.Root bdCustomer = new BDCustomer.Root
{
Model = new BDCustomer.Model
{
FCreateOrgId = new BDCustomer.FCreateOrgId { FNumber = "101" },
FNumber = "D888888",
FUseOrgId = new BDCustomer.FUseOrgId { FNumber = "101" },
FName = "测试账号888888",
FCOUNTRY = new BDCustomer.FCOUNTRY { FNumber = "China" },
FPROVINCIAL = new BDCustomer.FPROVINCIAL { FNumber = "" },
FCompanyClassify = new BDCustomer.FCompanyClassify { FNumber = "" },
FCompanyNature = new BDCustomer.FCompanyNature { FNumber = "" },
FCompanyScale = new BDCustomer.FCompanyScale { FNumber = "" },
FSUPPLIERID = new BDCustomer.FSUPPLIERID { FNumber = "" },
FGROUPCUSTID = new BDCustomer.FGROUPCUSTID { FNumber = "" },
FCorrespondOrgId = new BDCustomer.FCorrespondOrgId { FNumber = "" },
FSALDEPTID = new BDCustomer.FSALDEPTID { FNumber = "" },
FSELLER = new BDCustomer.FSELLER { FNumber = "" },
FSETTLETYPEID = new BDCustomer.FSETTLETYPEID { FNumber = "" },
FRECCONDITIONID = new BDCustomer.FRECCONDITIONID { FNumber = "" },
FPRICELISTID = new BDCustomer.FPRICELISTID { FNumber = "" },
FDISCOUNTLISTID = new BDCustomer.FDISCOUNTLISTID { FNumber = "" },
FRECEIVECURRID = new BDCustomer.FRECEIVECURRID { FNumber = "" },
FIsDefPayer = "False",
FIsGroup = "False",
FCustTypeId = new BDCustomer.FCustTypeId { FNumber = "KHLB001_SYS" },
FGroup = new BDCustomer.FGroup { FNumber = "YSKH01" },
FTRADINGCURRID = new BDCustomer.FTRADINGCURRID { FNumber = "PRE001" },
FTaxType = new BDCustomer.FTaxType { FNumber = "SFL02_SYS" },
FInvoiceType = "增值税专用发票",
FTaxRate = new BDCustomer.FTaxRate { FNumber = "SL01_SYS" },
FPriority = "1",
FISCREDITCHECK = "True",
FIsTrade = "True",
F_db_official_client_id = "888888",
FT_BD_CUSTOMEREXT = new BDCustomer.FTBDCUSTOMEREXT{
FEnableSL = "False",
FFreezeOperator = new BDCustomer.FFreezeOperator { FUserID = "0" },
FPROVINCE = new BDCustomer.FPROVINCE { FNumber = "" },
FCITY = new BDCustomer.FCITY { FNumber = "" },
FDefaultConsiLoc = new BDCustomer.FDefaultConsiLoc { FNumber = "" },
FDefaultSettleLoc = new BDCustomer.FDefaultSettleLoc { FNumber = "" },
FDefaultPayerLoc = new BDCustomer.FDefaultPayerLoc { FNumber = "" },
FDefaultContact = new BDCustomer.FDefaultContact { FNumber = "" },
FMarginLevel = "0",
FDebitCard = ""
},
FT_BD_CUSTLOCATION = new List
new BDCustomer.FTBDCUSTLOCATION{
FContactId= new BDCustomer.FContactId {
FNumber=""},
FIsDefaultConsigneeCT="false"
}},
FT_BD_CUSTBANK = new List
new BDCustomer.FTBDCUSTBANK{
FENTRYID="0",
FCOUNTRY1= new BDCustomer.FCOUNTRY1{FNumber=""},
FOPENBANKNAME="",
FBANKCODE="",
FACCOUNTNAME="",
FBankTypeRec= new BDCustomer.FBankTypeRec{FNumber=""},
FOpenAddressRec="",
FCNAPS="",
FCURRENCYID= new BDCustomer.FCURRENCYID{FNumber=""},
FISDEFAULT1="false"
}},
FT_BD_CUSTCONTACT = new List
new BDCustomer.FTBDCUSTCONTACT{
FENTRYID="0",
FNUMBER1="",
FNAME1="",
FADDRESS1="",
FTRANSLEADTIME1="0",
FMOBILE="",
FIsDefaultConsignee="false",
FIsDefaultSettle="false",
FIsDefaultPayer="false",
FIsUsed="false"
}},
FT_BD_CUSTORDERORG = new List
new BDCustomer.FTBDCUSTORDERORG{
FEntryID = "0",
FOrderOrgId = new BDCustomer.FOrderOrgId{ FNumber = "" },
FIsDefaultOrderOrg = "false"
}}
}
};
sJon = JsonConvert.SerializeObject(bdCustomer);
sJon = sJon.Replace("null", "\"\"");
iResult = client.Save("BD_Customer", sJson);
if (iResult != null)
{
responseInfo = JsonConvert.DeserializeObject
困扰几天了,根据返回信息添加了Id字段,还是返回同样错误,目前已无头绪。。。
跪求大神解答~~~
推荐阅读