I am trying to get ID of the record inserted in trigger (after insert).
for(AM_Setup__c i:trigger.new) {
setupid=Trigger.newMap.get(i.Id).id;
}
I think i am doing that in wrong way.
Kindly Help me out !!!
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityIn an after insert trigger, the records have been given IDs so you can simply say
for(AM_Setup__c i:trigger.new) {
setupid = i.Id;
}
i.Id
is the Id of the record in your code snippet