-
Using generic sObject to change fields of different Object types.
Hi guys,
I was trying to use the generic 'sObject' type to change the name field of any Standard or custom object in my org ( provided it has a field with API name = 'Name'). I used it as:
for(sObject a:sobj)
{
a.Name = 'Test';
}It gives the following error:
'Field expression not allowed for generic SObject'
Can anyone help me? Thanks
Log In to reply.
Popular Salesforce Blogs
Salesforce PDO Partner Program 2021: A Guide
Salesforce AppExchange has been a huge hit across its 15-year lifespan and is the key differentiator for Salesforce when it comes to the global CRM…
No Duplicates - Duplicate Management for Salesforce
No Duplicates is a brand new duplicate management app that is completely free. The app automates the entire deduplication process and provides reports for your…
Popular Salesforce Videos
How to Automate Business Processes in Salesforce CRM | Salesforce Flow Explained
Want to streamline your business processes without diving into complex coding? In this video, Kirill, an AQA engineer and certified Process Automation Professional at ENWAY,…
Custom Types in Lightning-datatable | Interchange | Salesforce Tutorial
First episode of our new Interchange series, in which we will deep dive in how to define custom types for a lightning-datatable component. Concretely, we’ll…
Develop Lightning Web Components Faster with Local Development Server | Developer Quick Takes
The Local Development Server is a Salesforce CLI plug-in that configures and runs a Lightning Web Components-enabled server on your computer. You can develop Lightning…