-
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
Query on Big Objects in Salesforce
Query on Big Objects Big objects can be queried by using SOQL or Async SOQL and because it is designed to handle a large amount…
A Gift! for Salesforce Developers - Automatically convert Existing Visualforce Pages to Lightning (Beta)
Yes! that's right. It's a beautiful gift from Salesforce, giving us (developers) the ability to code in both Lightning Experience and Classic without having to…
How Salesforce Technology is Changing Marketing and Customer Engagement
How Technology Will Change Marketing and Customer Engagement The application of artificial intelligence or AI to many business processes seems limitless now that we continue…
Popular Salesforce Videos
Google Chrome Extensions for Salesforce
In this video we are going to learn about the various Google chrome extensions which can be useful while we are working inside the Salesforce…
Salesforce Communities: 5 Powerful Ways to Drive Growth
Salesforce Communities are brand spaces designed specifically for Salesforce customers to connect with the community outside their org (i.e., employees, partners, and customers) and collaborate…
Is the Salesforce Marketing Cloud the Future For Business?
As the market changes, one needs to keep up with the times. Companies are interested in Salesforce Marketing Cloud because it gives them a competitive…