While trying to create a custom business rule using Apex I got the error:
INVALID_ID_FIELD, SaveAsActivity is not allowed with whatId that is not supported as a task whatId.
...and found out that it was caused by the method setSaveAsActivity
on my code, that was like:
msg.setSaveAsActivity(true); // "msg" is a SingleEmailMessage
What am I doing wrong here?