-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
4Questions
-
4Replies
API Calls Threshold Issue
How do I find out what is causing us to hit this threshold in a 24 hour period?
- omate
- February 19, 2016
- Like
- 0
- Continue reading or reply
Need Salesforce Developer to Build an Apex Trigger
As a work around we would like to have Salesforce create a new lead record whenever a form is submitted and the brands do not match, even if the email addresses are the same.
The final lead flow should something like the following:
1.) De-dupe the incoming email address
-If the email address doesn't currently exist in Salesforce then create a new lead.
-If the email is a duplicate then compare brands.
2.) If the brand matches then update the current record.
3.) If the brand doesn't match then create a new lead record and assign the new record to a sales rep.
- omate
- August 01, 2014
- Like
- 1
- Continue reading or reply
Problem firing email notification from workflow rule
The issue is that if a lead already exists in Salesforce but not in the Pardot database and then the same lead submits a Pardot form no email notification is fired. If the lead already exists in both Pardot and Salesforce then the notification triggers correctly. The rule we are currently using to trigger lead update notifications is below. Both 'pi__last_activity__c' and 'Form_Name__c' are dependent on a Pardot form being submitted.
AND(
NOT(ISNEW()),
ISCHANGED( pi__last_activity__c ),
ISCHANGED(Form_Name__c)
)
- omate
- June 09, 2014
- Like
- 0
- Continue reading or reply
Setup Conditional Logic to Update or Insert a Record
This is my first attempt at writing a Salesfroce trigger so please bear with me.
The company I work for has three different brands that all use the same Salesfoce account. Each brand has several sales reps that cross-sell different products within their specific brand but DO NOT cross-sell between brands. It is important that each sales rep within each brand maintains ownership of their lead whenever a new form submission comes in and the Principle Interest matches their brand. I am trying to write an Apex trigger that will do the following when a new form submission comes in.
1.) Check for a duplicate email address in Salesforce.
2.) If a duplicate email address is found it will then compare the Principle Interest of the record currently in the database with the Priniciple Interest of the incoming form.
3.) If the Principle Interests match then the current record is updated in the database and the lead owner is left unchanged. If they don't match then a new lead record is created using the information from the form submission and a new lead owner is assigned.
I think I have # 1 and #2 taken care of but #3 is givining me a lot fo difficulty.
This is the trigger I have written so far.
trigger SetLeadOwner on Lead (before insert) {
for (Lead myLead : Trigger.new) {
List<Lead> dupesLead = [
SELECT Id, Principle_Interest__c
FROM Lead
WHERE Email = :myLead.Email
];
Set<String> BrandOneSet = new Set<String>();
List<String> BrandOneList = new List<String>();
BrandOneList.add('PrincipleInterest1');
BrandOneList.add('PrincipleInterest2');
BrandOneList.add('PrincipleInterest3');
BrandOneSet.addAll(BrandOneList);
Set<String> BrandTwoSet = new Set<String>();
List<String> BrandTwoList = new List<String>();
BrandTwoList.add('PrincipleInterest4');
BrandTwoList.add('PrincipleInterest5');
BrandTwoList.add('PrincipleInterest6');
BrandTwoList.add('PrincipleInterest7');
BrandTwoList.add('PrincipleInterest8');
BrandTwoList.add('PrincipleInterest9');
BrandTwoSet.addAll(BrandTwoList);
Set<String> BrandThreeSet = new Set<String>();
List<String> BrandThreeList = new List<String>();
BrandThreeList.add('PrincipleInterest10');
BrandThreeList.add('PrincipleInterest11');
BrandThreeList.add('PrincipleInterest12');
BrandThreeSet.addAll(BrandThreeList);
if(myLead.email != null){
if (dupesLead.size() == 0) { // check for duplicate emails. if none found, create new lead.
// insert myLead;
} else if (dupesLead[0].Principle_Interest__c == myLead.Principle_Interest__c) {
update dupesLead[0];
} else if (BrandOneSet.contains(myLead.Principle_Interest__c) && BrandOneSet.contains(dupesLead[0].Principle_Interest__c)) {
update dupesLead[0];
} else if (BrandTwoSet.contains(myLead.Principle_Interest__c) && BrandTwoSet.contains(dupesLead[0].Principle_Interest__c)) {
update dupesLead[0];
} else if (BrandThreeSet.contains(myLead.Principle_Interest__c) && BrandThreeSet.contains(dupesLead[0].Principle_Interest__c)) {
update dupesLead[0];
} else { // What happens if the Principle Interests don't match up
// insert myLead;
}
} // End (myLead.email != null)
} // End (Lead myLead : Trigger.new)
}
Any help would be greatly appreciated.
Thanks,
Eric
- omate
- March 19, 2014
- Like
- 0
- Continue reading or reply
Need Salesforce Developer to Build an Apex Trigger
As a work around we would like to have Salesforce create a new lead record whenever a form is submitted and the brands do not match, even if the email addresses are the same.
The final lead flow should something like the following:
1.) De-dupe the incoming email address
-If the email address doesn't currently exist in Salesforce then create a new lead.
-If the email is a duplicate then compare brands.
2.) If the brand matches then update the current record.
3.) If the brand doesn't match then create a new lead record and assign the new record to a sales rep.
- omate
- August 01, 2014
- Like
- 1
- Continue reading or reply
Problem firing email notification from workflow rule
The issue is that if a lead already exists in Salesforce but not in the Pardot database and then the same lead submits a Pardot form no email notification is fired. If the lead already exists in both Pardot and Salesforce then the notification triggers correctly. The rule we are currently using to trigger lead update notifications is below. Both 'pi__last_activity__c' and 'Form_Name__c' are dependent on a Pardot form being submitted.
AND(
NOT(ISNEW()),
ISCHANGED( pi__last_activity__c ),
ISCHANGED(Form_Name__c)
)
- omate
- June 09, 2014
- Like
- 0
- Continue reading or reply
Setup Conditional Logic to Update or Insert a Record
This is my first attempt at writing a Salesfroce trigger so please bear with me.
The company I work for has three different brands that all use the same Salesfoce account. Each brand has several sales reps that cross-sell different products within their specific brand but DO NOT cross-sell between brands. It is important that each sales rep within each brand maintains ownership of their lead whenever a new form submission comes in and the Principle Interest matches their brand. I am trying to write an Apex trigger that will do the following when a new form submission comes in.
1.) Check for a duplicate email address in Salesforce.
2.) If a duplicate email address is found it will then compare the Principle Interest of the record currently in the database with the Priniciple Interest of the incoming form.
3.) If the Principle Interests match then the current record is updated in the database and the lead owner is left unchanged. If they don't match then a new lead record is created using the information from the form submission and a new lead owner is assigned.
I think I have # 1 and #2 taken care of but #3 is givining me a lot fo difficulty.
This is the trigger I have written so far.
trigger SetLeadOwner on Lead (before insert) {
for (Lead myLead : Trigger.new) {
List<Lead> dupesLead = [
SELECT Id, Principle_Interest__c
FROM Lead
WHERE Email = :myLead.Email
];
Set<String> BrandOneSet = new Set<String>();
List<String> BrandOneList = new List<String>();
BrandOneList.add('PrincipleInterest1');
BrandOneList.add('PrincipleInterest2');
BrandOneList.add('PrincipleInterest3');
BrandOneSet.addAll(BrandOneList);
Set<String> BrandTwoSet = new Set<String>();
List<String> BrandTwoList = new List<String>();
BrandTwoList.add('PrincipleInterest4');
BrandTwoList.add('PrincipleInterest5');
BrandTwoList.add('PrincipleInterest6');
BrandTwoList.add('PrincipleInterest7');
BrandTwoList.add('PrincipleInterest8');
BrandTwoList.add('PrincipleInterest9');
BrandTwoSet.addAll(BrandTwoList);
Set<String> BrandThreeSet = new Set<String>();
List<String> BrandThreeList = new List<String>();
BrandThreeList.add('PrincipleInterest10');
BrandThreeList.add('PrincipleInterest11');
BrandThreeList.add('PrincipleInterest12');
BrandThreeSet.addAll(BrandThreeList);
if(myLead.email != null){
if (dupesLead.size() == 0) { // check for duplicate emails. if none found, create new lead.
// insert myLead;
} else if (dupesLead[0].Principle_Interest__c == myLead.Principle_Interest__c) {
update dupesLead[0];
} else if (BrandOneSet.contains(myLead.Principle_Interest__c) && BrandOneSet.contains(dupesLead[0].Principle_Interest__c)) {
update dupesLead[0];
} else if (BrandTwoSet.contains(myLead.Principle_Interest__c) && BrandTwoSet.contains(dupesLead[0].Principle_Interest__c)) {
update dupesLead[0];
} else if (BrandThreeSet.contains(myLead.Principle_Interest__c) && BrandThreeSet.contains(dupesLead[0].Principle_Interest__c)) {
update dupesLead[0];
} else { // What happens if the Principle Interests don't match up
// insert myLead;
}
} // End (myLead.email != null)
} // End (Lead myLead : Trigger.new)
}
Any help would be greatly appreciated.
Thanks,
Eric
- omate
- March 19, 2014
- Like
- 0
- Continue reading or reply