• Doug Heindel
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

I am using the following trigger to update the Opportunity Stage when a Quote is "Accepted". 

 

 

trigger quoteupdate on Quote (after update) {

Set<String> quote=new Set<String>();
for(Quote q : Trigger.new)
{
if(q.Status=='Accepted')
quote.add(q.OpportunityId);
}
for(Opportunity opp : [select id, StageName from Opportunity where id in: quote])
{
opp.StageName='Closed Won - Not Live';
update opp;
}
}

 

 

Anyone know how I could also make the "Accepted" quote also sync to the opportunity without having to manually press the Start Sync?

 

Thanks in advance for any help here.

Hi All,

 

I've created a round robin lead assignment rule on inbound lead sources (see Steps taken so far: below).

 

However when a lead is entered with a non-inbound lead source (i.e. Conference or Networking) the rule skips a sales rep so it is not fairly distrbuted (see Example of the fail:
below).

 

I was wondering if anyone has create a Read Only Number field and a trigger that updates it +1 only if the Lead Source is one of the desired inbound ones. 

 

Anyone have any thoughts on this?

 

_____________________

 

Example of the fail:
Auto-number: 0000 - Lead Source: Facebook Ads - Goes to Rep 1
Auto-number: 0001 - Lead Source: Conference - Would go to rep 2 but does not because of lead source
Auto-number: 0002 - Lead Source: Networking - Would go to rep 3 but does not because of lead source
Auto-number: 0003 - Lead Source: LinkedIn Ads - Goes to Rep 4

 

Steps taken so far:

1. Created an AutoNumber custom field on Lead (e.g.,"Lead Number").

 

2. Created a formula custom field on Lead (e.g.,"Round Robin ID"), data type number, formula =

IF(ISPICKVAL(LeadSource, "Facebook Ads"), 1 +MOD(VALUE({!Lead_Number__c}), 7),
IF(ISPICKVAL(LeadSource, "LinkedIn Ads"), 1 +MOD(VALUE({!Lead_Number__c}), 7),
IF(ISPICKVAL(LeadSource, "Display Ads"), 1 +MOD(VALUE({!Lead_Number__c}), 7),
null)))

 

3. Created an assignment rule on the Round Robin ID field, whose values will vary between 1 and 7.

  • Round Robin ID 1 assign to Rep #1
  • Round Robin ID 2 assign to Rep #2
  • Round Robin ID 3 assign to Rep #3
  • Round Robin ID 4 assign to Rep #4
  • Round Robin ID 4 assign to Rep #5
  • Round Robin ID 4 assign to Rep #6
  • Round Robin ID 4 assign to Rep #7