-
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

Top 10 Salesforce Podcasts You Must Follow in 2021
Whether you’re a novice Salesforce user or someone with years of experience using its CRM features, there’s always more that you can learn about it.…

What is SOQL in Salesforce in 2023? | The Developer Guide
In this Blog we will learn about SOQL in salesforce. What is SOQL? SOQL stands for Salesforce Object Query Language. When we have to perform…

Marketing Cloud: Single Send Journeys versus Send Flows
If you have used Journey Builder recently, you probably noticed that Salesforce Marketing Cloud has introduced a new feature called “Single Send Journey”. This is…
Popular Salesforce Videos
Basics of Salesforce Flow in 15 minutes
In this video, Jitendra Zaa gives a detailed overview of the basics of Salesforce Flow in just 15 minutes. He covers everything from how to…
Salesforce Work.com New Features
Work.com includes new solutions to accelerate the private and public sector's answer to the COVID-19 pandemic, ranging from contact tracing and emergency response management to…
Why Salesforce is a Good Entrepreneurial Opportunity for Veterans
Are you a military veteran or military spouse? Have you dreamed of having your own business? This video is for you! This video covers an…