You need to sign in to do that
Don't have an account?
pradeep m 27
trigger StudentIdnew on Account (Before Insert) {
map<Account,Account Number> map1=trigger.newmap;
for(Account a : map1.values){
if(a.AccountNumber == null){
a.AccountNumber = '12345';
}
}
}
Error: Compile Error: unexpected token: 'map' at line 3 column 0
trigger StudentIdnew on Account (Before Insert) {
map<Account,Account Number> map1=trigger.newmap;
for(Account a : map1.values){
if(a.AccountNumber == null){
a.AccountNumber = '12345';
}
}
}
Example 1:-
Example 2:-
Example 3:-
Please mark this as solution if this will resolve your issue.
Thanks
Amit Chaudhary
Trigger.newMap - A map of IDs to the new versions of the sObject records.Note that this map is only available in before update, after insert, and after update triggers.
If not satisfied then can open this link : http://salesforceprasad.blogspot.in/2014/10/triggernewmap-and-triggeroldmap-in.html