-
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

Introduction to Salesforce Maps
Introduction Salesforce maps is an add-on paid product of Salesforce. It is a geo-location intelligence app that helps the business to optimize sales process territory…

How Does Salesforce for Small Businesses Help to Get Leads?
You all have heard that Salesforce for small businesses is changing the gear of every operation. But you might not be aware of the actual…

Unboxing Salesforce Knowledge Rest APIs
SF knowledge rest APIs come in 4 different flavours (Types) based on the polymorphic nature of the data model and each different type (as below)…
Popular Salesforce Videos
Creating Multi Screen Wizard Using Apex and Visualforce Salesforce
Watch this video to learn how to create a Multi-screen wizard using Apex and Visualforce Salesforce. If you have any questions do let us know…
Salesforce Development and Career Opportunities
Salesforce is the world’s #1 customer relationship management (CRM) platform. Salesforce allows sales reps to see everything about a customer in one place and provide…
Salesforce Winter '22 Product Release Highlights!
Watch this video to learn about the Salesforce Winter '22 Product Release Highlights. 0:00 - Winter Release Preview 0:10 - Pipeline Inspection Enhancements 0:23 -…