Hi.
I’m trying to update a Patient Encounter using PHP, but I get this weird error:
frappe.exceptions.DocstatusTransitionError: Cannot change docstatus from 0 to 2
$ch = curl_init($baseurl . 'api/resource/Patient%20Encounter');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
"docstatus":"1", "patient":"' . $_POST["patient"] .",
...rest of post data...}');
Now if I remove the "docstatus":"1"
-part the data gets inserted but only as a draft. The only thing that’s not working is the “docstatus”-part. The docstatus = 1 part submits the document, and that is what I need.
Any ideas why it is like that?
Thank you.