-
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 Integrations - Enterprise Portfolio Considerations
Why Salesforce Integration? What are the Benefits? We live in a world where even the smallest of organizations have multiple systems in their IT Footprint…
Learn All About Salesforce Industry Clouds
The world today is undergoing a process of extreme digitization that reaches all sectors and industries of society. Undoubtedly, the Covid-19 pandemic was an important…
Learn About Salesforce Einstein Prediction Builder
The Einstein Prediction Builder can help you predict which opportunities will close and which goods prospects will buy. Predictions may be created based on the…
Popular Salesforce Videos
Build a Simple Screen Flow with Salesforce Flow Builder
Did you know that you can build interactive custom components without any code? Flow Builder is a powerful tool for automation and for giving Admins…
Launch of Virtual Sales Tools | Salesforce 360: New Features
Salesforce has announced new Sales Cloud and supporting features to make virtual sales experiences more engaging and productive. In a nutshell, Salesforce is releasing 4…
How to Connect to External Data | Salesforce
An external data source specifies how to access an external system. Salesforce Connect uses external data sources to access data that's stored outside your Salesforce…