Find your content:

Search form

You are here

sharing opportunities with partners

 
Share

Is there a way of sharing opportunities that are not closed with specific license type or profiles? I want to be able to share only closed opportunities with my partners.


Attribution to: user7671

Possible Suggestion/Solution #1

Opportunities can be shared through a partner portal using partner licenses. They can be read-only, create or update. They're not visible at all through a Communities portal unless you "mirror" them out to the portal using custom objects and triggers. That would be one way of doing what you want for your "read only" closed opportunities situation. I just finished a project of that nature using a HVCP license for a client.


Attribution to: crmprogdev

Possible Suggestion/Solution #2

Create a Force.com Site (less ideal) or a Partner Community (ideal) to share those Opportunities with partners. This also lets you segment other things the partners can see if they are internal users, as it sounds like you have them today.


Attribution to: DavidSchach

Possible Suggestion/Solution #3

Something like this may be what you're looking for:

public static void processOpportunityShares(List<Opportunity> opps)
{
    List<OpportunityShare> oppShares = new List<OpportunityShare>();
    for(Opportunity o : opps)
    {
        if(o.IsClosed)
        {
            OpportunityShare os = new OpportunityShare();
            os.OpportunityId = o.Id;
            os.OpportunityAccessLevel = 'Edit';
            // os.UserOrGroupId = id of user you wish to share this opportunity with
            oppShares.add(os);
        }
    }

    Database.SaveResult[] results = Database.insert(oppShares, false);
    for(Database.SaveResult sr : results)
    {
        if(sr.isSuccess())
        {
            system.debug('Partner Share successful');
        }
        else
        {
            Database.Error err = sr.getErrors()[0];
            if(err.getStatusCode() == StatusCode.FIELD_FILTER_VALIDATION_EXCEPTION && err.getMessage().contains('AccessLevel'))
            {
                system.debug('Partner Share successful');
            }
            else
            {
                system.debug('Partner Share unsuccessful');
            }
        }
    }
}

Attribution to: Adam
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/31631

My Block Status

My Block Content