MIXED_DML_OPERATION error
如果你遇到以下的错误:
System.DmlException: Insert failed. First exception on row 0; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): User, original object: LTCVariables__c: []
解决的办法就是调用异步方法,如果入参是primitive的,@future为首选;如果是non-primitive的,可以用Queueable来解决。