-
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
Learn All About Data Modeling in Salesforce
Introduction A data model is a way to store/represent data in a database consisting of tables with columns and rows. In Salesforce, data is stored…
All You Need to Know About Salesforce Experience Cloud
In April 2021, Salesforce decided to change its Community Cloud for a more modern service. The need to move over to the digital world has…
What is Pardot? What is Engagement History in Salesforce in 2023?
Pardot is a software as a service (SaaS) marketing automation platform by SalesForce offering email automation, targeted email campaigns, and lead management for B2B sales…
Popular Salesforce Videos
GS DevOps Mate: Your Free Flexible Toolkit for Faster & Smoother Salesforce Deployments
Our webinar about GS DevOps Mate: A free, open-source, CI/CD platform agnostic toolkit! Our host is Rohan Gore a Technical Architect here at Groundswell who…
Get Rich Insights on Your Salesforce Users With Tableau | Did You Know
Did you know you can use Tableau to get rich insights on your Salesforce users? Login history, geo, browser, OS, and more are all at…
Creating a Rollup Using DLRS | Salesforce Tutorial
In certain situations, an object does not support a roll-up, or the relationship is not permitted. Learn how to make it possible by using the…