-
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

The Role of Salesforce’s Impact Fund in Developing Startups
Today, there is an increasing number of cloud companies trying to impact the industry and the world. Salesforce has been one of them for years,…

Salesforce and ERP Integration - Learn All About It
As technology is advancing in every domain of business, many related problems or issues are rising simultaneously. Every enterprise or organization wants to run its…
Popular Salesforce Videos
Scheduled Actions Workflow Rules, Process Builder and Lightning Flow
Time-dependent actions are executed at a specific time, such as 10 days before a record's close date. When that specific time passes, the workflow rule…
How To Become A Salesforce Administrator | Salesforce Administrator Training
This "How to become a Salesforce Administrator" video will help you understand who is a Salesforce Administrator and what are their roles and responsibilities. It…
How to import data from Sage ERP to Salesforce - Part 1
Greytrix offers GUMU™ integration for Salesforce with Sage ERP systems - a best-of-breed solution for organizations to enhance their customer interaction. With Salesforce and Sage…