13 lines
372 B
Plaintext
13 lines
372 B
Plaintext
trigger AssignAccountOwner on Account (before insert)
|
|
{
|
|
Map<String, Id> industryUserMap = new Map<String, Id>{
|
|
'Technology' => 'UI1',
|
|
'Healthcare' => 'UI2'
|
|
};
|
|
for (Account acc : Trigger.new)
|
|
{
|
|
if (industryUserMap.containsKey(acc.Industry)) {
|
|
acc.OwnerId = industryUserMap.get(acc.Industry);
|
|
}
|
|
}
|
|
} |