You can achieve this using Custom Setting and trigger. Create a custom setting Lets Say Name is ZipAndUsers with fields Name(Text - Put yor ZipCode in this field) and create new Custom Field for UserId(Id OR Text).Load your custom setting data using dataloader . This code should work for you. PLease change your custom setting name and field names as required:
trigger assignOwner on Lead (before insert, before update) {
Map<Id, Delivery__c> mapOfDeliveryRecords = new Map<Id, Delivery__c>();
List<Item_Distributed__c> lstItemDestriBute = new List<Item_Distributed__c>();
Map<String,CustomSettingName__c> allCodes = CustomSettingName__c.getAll();
for(Lead led : Trigger.new) {
if(allCodes.containsKey(led.ZipCodeField)){
led.OwnerId = allCodes.get(led.ZipCodeField).UserIdField;
}
}
}
I am sorry but currenly i can not write whole steps to create this and write trigger for you. also it's not possible to do it without login in your ORG.
you need to find someone (Saqlesforce Developer) near you who can code for you. :)
You can achieve this using Custom Setting and trigger. Create a custom setting Lets Say Name is ZipAndUsers with fields Name(Text - Put yor ZipCode in this field) and create new Custom Field for UserId(Id OR Text).Load your custom setting data using dataloader . This code should work for you. PLease change your custom setting name and field names as required:
trigger assignOwner on Lead (before insert, before update) {
Map<Id, Delivery__c> mapOfDeliveryRecords = new Map<Id, Delivery__c>();
List<Item_Distributed__c> lstItemDestriBute = new List<Item_Distributed__c>();
Map<String,CustomSettingName__c> allCodes = CustomSettingName__c.getAll();
for(Lead led : Trigger.new) {
if(allCodes.containsKey(led.ZipCodeField)){
led.OwnerId = allCodes.get(led.ZipCodeField).UserIdField;
}
}
}
You can achieve this using Custom Setting and trigger.
Create a custom setting Lets Say Name is ZipAndUsers with fields Name(Text - Put yor ZipCode in this field) and create new Custom Field for UserId(Id OR Text).Load your custom setting data using dataloader .
This code should work for you. PLease change your custom setting name and field names as required:
PLease mark as best answer if helped.
Regards,
Ramakant
All Answers
As per my knowledge you don't need to write trigger to achieve this. Lead assignment rules could do the trick.
Please let me know if you need more help.
Regards,
Ramakant
there is a solution for this on comminity.
https://success.salesforce.com/answers?id=9063A000000iUJ4QAM
Hope this will help you :)
Thanks
Vinod
I am sorry but currenly i can not write whole steps to create this and write trigger for you.
also it's not possible to do it without login in your ORG.
you need to find someone (Saqlesforce Developer) near you who can code for you. :)
Thanks
Vinod
You can achieve this using Custom Setting and trigger.
Create a custom setting Lets Say Name is ZipAndUsers with fields Name(Text - Put yor ZipCode in this field) and create new Custom Field for UserId(Id OR Text).Load your custom setting data using dataloader .
This code should work for you. PLease change your custom setting name and field names as required:
PLease mark as best answer if helped.
Regards,
Ramakant