HTTP Callouts and DML: The Transaction Order Trap
Understanding why performing DML before an HTTP callout throws an uncommitted work error, and how to structure your Apex transactions to avoid it.
Understanding why performing DML before an HTTP callout throws an uncommitted work error, and how to structure your Apex transactions to avoid it.