A fresher question.
We have a custom object named "CaseLogger".
CaseLogger does not have any custom fields.
Whenever a new Case is created, a CaseLogger record will be created with it's "Name" field being a concatenation of "Case Id + Case Origin".
For example let's think of a scenario in which Case C is created. Its Origin is "Email" and its Id is "19191".
Then a new CaseLogger
record will be created as follows
CaseLogger.Name = 19191Email
I wrote the following trigger.
trigger CaseTrigger on Case ( after insert)
{
List<CaseLogger__c> l = null;
for(Case c : Trigger.new)
{
//I am stuck here
}
insert l;
}
I know the code that I wrote is not much.
I know that we always have to "bulkify" and should use DML wisely.
So If 1 is to be honored, then I assume that Case records present in Trigger.new are to be stored in a collection.
But I am unable to find a method in List class that can allow me to create CaseLogger list entries with only data given for one of its fields
For example something like
l (the collection from the above code snippet)
l.Name.add(c.id+c.Origin)
Can someone help ?