• RAJIVRG
  • NEWBIE
  • 0 Points
  • Member since 2007

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

Need Help-Requirements for Bulk loading Opportunities for Partner Users:

Partners need the ability to bulk upload (Insert and Update) Salesforce.com opportunities via an existing CSV/Excel template.  There are 1800 partners which will use this functionality.  The system needs to allow users to browse for an Excel/CSV sheet on their computer and select the file. Upon select the file will be available to load. Successfully loaded opportunities to be visible under my opportunities.  The CSV template will have one row which has data for Account, Contact and Opportunity.

Cannot use Leads, Data Loader, Import or XL connector as these needs to be exposed to end users..

This seems easy enough, but it has me stumped.

 

Use Case: Partners create leads in the partner portal. When the lead is ready to convert, our reps change themselves to the owner and convert it. I want to automatically add (since they forget all the time) the partner user to the sales team.

 

Problem: When I convert the lead (i have the trigger running after insert) I get an error saying that the record is locked.

 

It looks to me like Salesforce inserts the opportunity record, but locks it so its uneditable through the conversion. My trigger also depends on a custom field being mapped over, so that's why I run the trigger after insert so that the field will be mapped over.

 

Any thoughts anyone on how to get around this?

 

Here's my code:

 

 trigger addPartnerToSalesTeam on Opportunity (after insert) {
    
    /**
    * Need to get the opportunity and user
    */
    private Opportunity[] newOpty = new Opportunity[1];
    newOpty = Trigger.new;    

    //get userId of lead creator
    String leadCreatorId = newOpty[0].Lead_Creator_Id__c;

    //get lead Creator profile Id
    User leadCreator = [select profileId from user where id =:leadCreatorId];
    
    newOpty[0].description = leadCreator.ProfileId;//testing
    
    //run trigger if the owner of the converted lead was a partner user
    if(leadCreator.ProfileId == '00e20000000uCnj') {
        newOpty[0].description = newOpty[0].description + ' It works!!!' + ' ' + leadCreatorId; //for testing
        addtoSalesTeam.addUser(newOpty[0], leadCreatorId);

    }//end if

        
}//end addPartnerToSalesTeam trigger

 ________________________________________________________________

 public class addToSalesTeam {
    
    /**
    * To run this method, the trigger (or whatever calls it) must pass two variables:
    *
    * @Opportunity opty = the opportunity being shared
    * @User theUser = the user to be shared with
    *
    */
    public static void addUser (Opportunity opty, String userId) {
        
        OpportunityTeamMember optyMemb = new OpportunityTeamMember();

        optyMemb.OpportunityId = opty.Id;       

        optyMemb.UserId = userId;     

        Database.Saveresult sr = Database.insert(optyMemb);

    }//end addPartner method

}//end AddToSalesTeam

Hello!

My company will be implementing Salesforce.com soon, and we are looking to acquire a consultant for its implementation. We currently work with the Creative Manager product, and would be looking to synchronize it through the API and perform other functions as well.

We are in the process of looking into a top partner with Salesforce, but we would like to know if there are any independant consultants available in the area, or who are willing to travel that can still mantain value over going with a larger firm.

Please let me know if you fit the bill or can make a recommendation.

Thank you!
Hi All, I am a certified salesforce consultant with 2+ yrs SFDC administrative exposure and total of 10 years in IT software, currently working as an SFDC administrator and technical consultant in a technology company based in India. I have expertise in salesforce implementation, integration, customization using s-Controls, designing workflows. I do freelancing during evenings and weekends. Thanks & Best Regards,
    We are new to salesforce and we need someone to set it up and make it work best for us. Is there anyone here near Naples Florida?

Todd
todd@4rss.com