• JLockard
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 12
    Replies

Hello,

I've seen many related posts, but nothing that has pushed me over the top for this problem.  Basically, I need a Lead trigger that can cause a Lead record to be run through the Lead Assignment rules if certain criteria are met on update of the Lead record.

 

One of the criteria is whether the current Lead Owner is an active or inactive SFDC user.  I had written the code to capture the owner status field via a SOQL select statement, but unfortunately this logic causes the apparently common mistake of having too many SOQL queries because the select statement was inside the For loop in the trigger code.

 

Based on the other posts for that error, I know that I'll need to use Sets and Maps to get it to work, but has anyone written a similar trigger before?

 

Basically, I need to capture the value of the isActive flag on the user record that corresponds to the Lead owner for each Lead being evaluated by the trigger.

 

Any help is appreciated.

 

Hello,

I posted this on the Idea site (http://sites.force.com/ideaexchange/ideaView?c=09a30000000D9xt&id=087300000006xx9&returnUrl=%2Fapex%2FideaList%3Fc%3D09a30000000D9xt%26sort%3Drecent) as well, but wondered if anyone has any suggestions on how to avoid the following "issue" I'm having with a Workflow Task.

 

Basically, I am trying to create a Task to be assigned to the user in a particular Role on the Sales Team.  However, if no user is defined in that Role, the Task is still created and implicitly assigned to the Opty Owner.  I can see scenarios where I'd be glad that is the functionality, but in the current case, I am already creating a Task for the Opty Owner from the same Workflow.  So, when no user is defined for the Sales Team role I am trying to create a Task for, the Opty Owner ends up with two identical tasks and, as you can imagine, this would not sit well with our Sales folks.

 

Any advice on how to get this to work so that the Opty Owner always gets a Task and the Task for the Sales Team member is only created when the at least one user is assigned to that Role?

 

TIA...

Hello,

I am attempting to write an Apex trigger to look up the ManagerID for the record owner, the post the Manager email address into a custom field on the current record.

 

I'm new to Apex and having difficulty developing this code, which seems like it should be relatively simple.

 

Anyone have examples of such functionality?

 

Thanks!

J

Hello,

I've seen many related posts, but nothing that has pushed me over the top for this problem.  Basically, I need a Lead trigger that can cause a Lead record to be run through the Lead Assignment rules if certain criteria are met on update of the Lead record.

 

One of the criteria is whether the current Lead Owner is an active or inactive SFDC user.  I had written the code to capture the owner status field via a SOQL select statement, but unfortunately this logic causes the apparently common mistake of having too many SOQL queries because the select statement was inside the For loop in the trigger code.

 

Based on the other posts for that error, I know that I'll need to use Sets and Maps to get it to work, but has anyone written a similar trigger before?

 

Basically, I need to capture the value of the isActive flag on the user record that corresponds to the Lead owner for each Lead being evaluated by the trigger.

 

Any help is appreciated.

 

I need a way to apply lead assignment rules whenever the lead score goes above 99 and the lead review status is complete.

 

Here is my trigger code:

 

 

trigger ApplyLeadAssignmentRules on Lead (before update, before insert) {


    for (Lead l:trigger.new) {


        Decimal score =   l.Score__c;
        String review_status =  l.Review_Status__c;

        if(score == null) score = 0.0;
        if(review_status == null) review_status = '';
            
        if( (score >= 100) && (review_status.equalsIgnoreCase('Complete'))  ){
            Database.DMLOptions dmo = new Database.DMLOptions();
            dmo.assignmentRuleHeader.useDefaultRule = true;
            l.setOptions(dmo);
            Database.update(l);   
        }     

    }


}

 

 

This throws the following exception:

 

Apex script unhandled trigger exception by user/organization:

Source organization:

ApplyLeadAssignmentRules: execution of BeforeUpdate

caused by: System.DmlException: Update failed. First exception on row 0 with id ; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 00QQ0000001Q2av) is currently in trigger ApplyLeadAssignmentRules, therefore it cannot recursively update itself: []

 

 

How do I fix this? Any solution?

I'm looking for help on how to tackle this need: we want to trigger the addition of several AEs to the sales team (all partner users) of an opportunity when their partner account is added as a partner to the opportunity. I'm completely stuck. Any ideas?

Dear All,

We want to limit the user permission in Salesforce plugin, and changed the O_Dictonary.xml file to this:

<OverrideOptions value="true">
<PutRegistry name="DisplaySplash" type="string" value"false"/> <PutRegistry name="DoNotRevertOptions" type="string"value"true"/>
<PutRegistry name="ModifyConflictResolution" type="string"value"false"/>
<PutRegistry name="ModifyFieldMappings" type="string"value"true"/>
<CanModifySyncEntities value="true" />
<Sync entity="Contact" value="false" />
<Sync entity="Event" value="true" />
<Sync entity="Task" value="true" />
<CanModifySyncDirection value="false" />
<SyncDirection entity="Contact" value="Both" />
<SyncDirection entity="Event" value="Import" />
<SyncDirection entity="Task" value="Export" /> <CanModifyConflictResolution value="false" />
</OverrideOptions> </Document>

But when I try to start up outlook afterwards, outlook crashes, and afterwards the salesforce plug-in is missing.

Can anybody help to tell me how the Put Registry strings needs to look like?

Thank you very much.

Best Regards
Ryan He

  • January 07, 2009
  • Like
  • 0
Hey folks. I have a user who's had plenty of problems just getting the outlook integration to load in her machine. Now that we have it working, she can't get any "add case" options, and in fact the tools - options - salesforce options is missing from her menu.
I am disinclined to remove and reinstall because of all the problems in the past.
Anyone have familiarity or tips to share?
  • November 10, 2008
  • Like
  • 0