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
CloudConversionCloudConversion 

Sites TypeException and SObjectException?

I'm getting the following two errors when trying to create a new record from a managed Salesforce Site and I have all the FLS setup correctly:

1.  ErrorSystem.TypeException: DML not allowed on CloudConversion__Activity__c (this one goes away if I put everything in the constructor)

2.  System.SObjectException: Field is not writeable: CloudConversion__Activity__c.CloudConversion__Lead__c

Any hints, suggestions or workarounds?

Thanks,
Jon
AlexWSFDCAlexWSFDC
What is the user context when this code gets executed?  Is that executed from an error page?  Is request done as "guest" user without login or is there login to portal?  What does URL look like when you request page that executes this code?