You need to sign in to do that
Don't have an account?
Vijay Bharghav
All Fileds with values for a specific record
hi
Hi I am new to Salesforce, Need help to have all fileds with values in a map for a specific record through apex class.
Example :('Name__C','Bharghav');
Regards
Vijay Bharghav
You already have this using dynamic DML. That allows you to take a record and retrieve the field values using the map syntax.
E.g.
public class YourController{
List<Account> accList = new List<Account>();
public YourController(){
accList = [SELECT name,AccountNumber,Industry FROM Account limit 1];
}
public void YourMethod(){
Map<String,String> aMap = new Map<String,String>();
aMap.put('Name','accList.get(0).name);
aMap.put('AccountNumber','accList.get(0).AccountNumber);
aMap.put('Industry','accList.get(0).Industry);
}
}
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
I am looking to get name,AccountNumber to form dyanmically.
Lets say i have an email template with MergeFileds . And i am seding mails to say record (0190000007jIZw)
Name:{!name__C}
Age :{!Age__C}
i wantt to have a map created with key as (name__C) and value as ('Bharghav'). So that but iterating over the map i can dynamically replce the email template with teh values.
Regards
Vijay Bharghav