3

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 !!!

2

1 Answer 1

7

In 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;
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .