You need to sign in to do that
Don't have an account?

API guide documentation bug: DML Not allowed on EmailServicesFunction
Either the article is wrong, or there's a bug as the doc says create() is supported on EmailServicesFunction but I can't insert from Apex.
Article says allowed methods:
create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), update(), upsert()
Error:
DML Not allowed on Email ServicesFunction
String emailServicesFunctionName='g2wSerializeGetRegistrants'; String emailHandlerApexClassName='g2wEmailHandlerSerializeGetRegistrants'; EmailServicesFunction e=new emailServicesFunction(); e.functionName=emailServicesFunctionName; ApexClass emailHandlerClass=[SELECT Id FROM ApexClass WHERE Name=:emailHandlerApexClassName LIMIT 1]; e.ApexClassId=emailHandlerClass.Id; e.isActive=TRUE; e.AddressInactiveAction='0'; e.AttachmentOption='0'; e.AuthenticationFailureAction='0'; e.AuthorizedSenders=''; e.IsAuthenticationRequired=FALSE;//require uber security? not needed here e.IsTlsRequired=FALSE; e.OverLimitAction='3'; insert e;