Future method cannot be called from a future or batch method

我们知道future方法在batch或者future方法中被调用,会报如下的错误:
caused by: System.AsyncException: Future method cannot be called from a future or batch method.

但有时候,因为batch触发了trigger,而trigger调用了future,也会出现同样的错误。

那如何解决呢?

有一种思路就是用Salesforce提供的Platform Event.

上一篇:解决intelliJ IDEA:Cannot resolve method““问题


下一篇:Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is