completed assignment
This commit is contained in:
13
force-app/main/default/triggers/AssignAccountOwner.trigger
Normal file
13
force-app/main/default/triggers/AssignAccountOwner.trigger
Normal file
@@ -0,0 +1,13 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user