Create inactive account

1.8k views Asked by At

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."
    }
}
1

There are 1 answers

1
Arun Vinoth-Precog Tech - MVP On BEST ANSWER

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

statecode field is not available for create. Record will be always created as active. The only way for you is to do 2 steps operation - create and set as inactive after.

In other words, statecode=0 is set as default by system, when you pass statuscode=2 in create payload - the platform validation kicks in and say this is invalid pair.