You need to sign in to do that
Don't have an account?
Pugalagiri J
System.sObjectException field <fieldname> is not editable
Trying to create sObject but getting error as below for certain fields
Error: System.sObjectException field <fieldname> is not editable
Code Snapshot:
Code in Account Change Event trigger (change data capture), with this code trying to convert Trigger.New to sObject
for (sObject event : Trigger.new)
{
Map<String, Object> fieldvalues = event.getPopulatedFieldAsMap();
sObject sObj = Schema.GetGlobalDescribe().get('Account').newSobject();
for(string FieldKey : fieldvalues.Keyset())
{
sObj.put(FieldKey,fieldvalues.get(FieldKey));
}
}
Any help?
Error: System.sObjectException field <fieldname> is not editable
Code Snapshot:
Code in Account Change Event trigger (change data capture), with this code trying to convert Trigger.New to sObject
for (sObject event : Trigger.new)
{
Map<String, Object> fieldvalues = event.getPopulatedFieldAsMap();
sObject sObj = Schema.GetGlobalDescribe().get('Account').newSobject();
for(string FieldKey : fieldvalues.Keyset())
{
sObj.put(FieldKey,fieldvalues.get(FieldKey));
}
}
Any help?
I might be your field is formula Or Edit permission is not given that user.
so, you can check profile of that user.
Or
In Object, go to the field & Relationship and search the field name and make sure that field is formula or not.
follow above steps and let me know if it helps you and if it helps you, marking it as best answer.
Thank You
Specific code will be executed by Process Automated user (asynchronous) since its been triggered from change event trigger (change data capture).
Basically I am trying to transform Trigger.New in to Sobject specific to the object type.
All failed fields are either Formula field or RollupSummary field, looks like this is the reason for the reported failure