I want to synchronize with another system, accounts, and if the entity is inactive in that system, I want to create the account with inactive status. something very simple like:
{
"accountnumber": "InactiveAcct",
"name": "Account that should be created as inactive",
"description": "demo",
"statecode": 1,
"statuscode": 2
}
I'm doing a POST request but as a reply I get:
{
"error": {
"code": "0x80048408",
"message": "2 is not a valid status code for state code AccountState.Active on account with Id e2d0f844-313e-eb11-a813-000d3a795762."
}
}
Unfortunately you cannot create (POST) an inactive record, you have to create it first and then make an update (PATCH) call to mark inactive. This is by design and it’s a limitation. Read more
In other words,
statecode=0
is set as default by system, when you passstatuscode=2
in create payload - the platform validation kicks in and say this is invalid pair.