使用this page文档作为指南,我正在努力使此帐户不再成为子帐户(暂时使用{{3 }}):
{
"Name": "Accumulated Depreciation",
"ParentRef": {
"value" : null
},
"sparse": true,
"Id": "4",
"SyncToken": "2"
}
我也尝试过明确地将属性设置为false(使用和,而不更新ParentRef属性)。
以下是:
{
"Name": "Accumulated Depreciation",
"ParentRef": {
"value" : null
},
"SubAccount": false,
"sparse": true,
"Id": "4",
"SyncToken": "2"
}
这里没有:
{
"Name": "Accumulated Depreciation",
"SubAccount": false,
"sparse": true,
"Id": "4",
"SyncToken": "2"
}
我没有收到错误,但是响应仍然将帐户显示为65的子级这一事实表明更新无效:
{
"Account": {
"Name": "Accumulated Depreciation",
"SubAccount": true,
"ParentRef": {
"value": "65"
},
"FullyQualifiedName": "Computer Hardware:Accumulated Depreciation",
"Active": true,
"Classification": "Asset",
"AccountType": "Fixed Asset",
"AccountSubType": "OtherFixedAssets",
"CurrentBalance": 0,
"CurrentBalanceWithSubAccounts": 0,
"domain": "QBO",
"sparse": false,
"Id": "4",
"SyncToken": "2",
"MetaData": {
"CreateTime": "2014-03-09T07:48:23-07:00",
"LastUpdatedTime": "2014-03-09T11:17:48-07:00"
}
},
"time": "2014-03-09T11:23:30.36-07:00"
}
你知道我错过了吗?
谢谢!
[玛纳斯回应后更新:]
我正在尝试使用完整更新但没有成功。以下是我尝试过的两个请求的正文:
{
"Name": "Accumulated Depreciation",
"SubAccount": false,
"ParentRef": {
"value": null
},
"FullyQualifiedName": "Accumulated Depreciation",
"Active": true,
"Classification": "Asset",
"AccountType": "Fixed Asset",
"AccountSubType": "OtherFixedAssets",
"CurrentBalance": 0,
"CurrentBalanceWithSubAccounts": 0,
"domain": "QBO",
"sparse": false,
"Id": "4",
"SyncToken": "2",
"MetaData": {
"CreateTime": "2014-03-09T07:48:23-07:00",
"LastUpdatedTime": "2014-03-09T11:17:48-07:00"
}
}
和...
{
"Name": "Accumulated Depreciation",
"SubAccount": false,
"FullyQualifiedName": "Accumulated Depreciation",
"Active": true,
"Classification": "Asset",
"AccountType": "Fixed Asset",
"AccountSubType": "OtherFixedAssets",
"CurrentBalance": 0,
"CurrentBalanceWithSubAccounts": 0,
"domain": "QBO",
"sparse": false,
"Id": "4",
"SyncToken": "2",
"MetaData": {
"CreateTime": "2014-03-09T07:48:23-07:00",
"LastUpdatedTime": "2014-03-09T11:17:48-07:00"
}
}
(我还尝试使用下面的美元货币区块在Manas的回复中,只是为了踢球。没有任何改变。)
在这两种情况下都没有发生任何事情,而且我的反应仍然如上所述。
答案 0 :(得分:-1)
帐户实体不支持稀疏更新。
请尝试完整更新。它会工作。
我从UI创建了一个子帐户,并将其作为子和非子(通过在UI中进行更改)检索..以下是两个响应。
子帐户
{
"Account":{
"Name":"TEST_SUB_ACCNT",
"SubAccount":true,
"ParentRef":{
"value":"54"
},
"Description":"Sub Account",
"FullyQualifiedName":"TEST_PARENT_ACCNT:TEST_SUB_ACCNT",
"Active":true,
"Classification":"Asset",
"AccountType":"Bank",
"AccountSubType":"Savings",
"CurrentBalance":200.0,
"CurrentBalanceWithSubAccounts":200.0,
"CurrencyRef":{
"value":"USD",
"name":"United States Dollar"
},
"domain":"QBO",
"sparse":false,
"Id":"55",
"SyncToken":"0",
"MetaData":{
"CreateTime":"2014-03-09T12:16:11-07:00",
"LastUpdatedTime":"2014-03-09T12:16:11-07:00"
}
},
"time":"2014-03-09T12:19:16.669-07:00"
}
非子帐户
{
"Account":{
"Name":"TEST_SUB_ACCNT",
"SubAccount":false,
"Description":"Sub Account",
"FullyQualifiedName":"TEST_SUB_ACCNT",
"Active":true,
"Classification":"Asset",
"AccountType":"Bank",
"AccountSubType":"Savings",
"CurrentBalance":200.0,
"CurrentBalanceWithSubAccounts":200.0,
"CurrencyRef":{
"value":"USD",
"name":"United States Dollar"
},
"domain":"QBO",
"sparse":false,
"Id":"55",
"SyncToken":"1",
"MetaData":{
"CreateTime":"2014-03-09T12:16:11-07:00",
"LastUpdatedTime":"2014-03-09T12:20:19-07:00"
}
},
"time":"2014-03-09T12:20:38.342-07:00"
}
使用devkit生成的更新请求(无效)
{ "AccountSubType" : "Savings",
"AccountType" : "Bank",
"Active" : true,
"Classification" : "Asset",
"CurrencyRef" : { "name" : "United States Dollar",
"value" : "USD"
},
"CurrentBalance" : 200.0,
"CurrentBalanceWithSubAccounts" : 200.0,
"Description" : "Sub Account",
"FullyQualifiedName" : "TEST_PARENT_ACCNT:TEST_SUB_ACCNT",
"Id" : "55",
"MetaData" : { "CreateTime" : "2014-03-10T00:46:11+05:30",
"LastUpdatedTime" : "2014-03-10T10:16:15+05:30"
},
"Name" : "TEST_SUB_ACCNT",
"SubAccount" : false,
"SyncToken" : "2",
"domain" : "QBO",
"sparse" : false
}
由于