function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jkucerajkucera 

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;