Currently, I'm facing a problem with DataVerse. I try to update the pre-defined statuscode column through the Web API using C# (and Postman).
I've tried to update with these lines of code
{
"statuscode": 1
}
The error is
1 is not a valid status code for state code (Entity)State.Inactive on (Entity) with Id.
Can anyone help me?
Thanks!
Setting the
statuscode, you always have to include the accordingstatecode. The error message you receive suggest that the currentstatecodeandstatuscodesignify aninactivestate and status (statecode = 1 and statuscode = 2).To set the record to
active, try setting thestatecodeto0.Valid statecode and statuscode combinations are varying across Dataverse entities so you need to make sure you pick the correct one for your case.