• SF-dev
  • NEWBIE
  • 0 Points
  • Member since 2010

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

I have added a Partner to an  Opportunity  from the Opportunity Detail page:  partner > New . 

 

However when I query the Opportunity Partner records as shown below , its giving me 2 records for the same Opportunity. 

 

SOQL used :

 

Select o.Role, o.ReversePartnerId, o.OpportunityId, o.IsPrimary, o.AccountTo.Name, o.AccountTo.Id, o.AccountToId From OpportunityPartner o where o.OpportunityId ='006T0000005RLCR'

 

Result : it returns 2 records ( with is identical)  where as the Opportunity has only one Opportunity Partner. 

 

after investigation , I came to know that the AccountToId is different in both the records - (a) one is the Account that I have selected while creating the partner  (b) other is the 'Account'  to which the Opportunity is linked.

 

I have checked the Partner records as well. 2 records created for the Partner as well.

 

SOQL used :

 

Select p.SystemModstamp, p.Role, p.ReversePartnerId, p.OpportunityId, p.LastModifiedDate, p.LastModifiedById, p.IsPrimary, p.AccountTo.Name, p.AccountToId, p.AccountFrom.Name, p.AccountFromId From Partner p where p.OpportunityId ='006T0000005RLCR'

 

Now my question is ,

 

1. What is the functionality behind this ? why 2 records get created when we add a partner to an opportunity ?

2. I need to clone the 'Partner' related to an Opportunity . Out of the 2 records which one I need to clone ? and for that what will be the query ?

 

Any help will be appreciated . Thanks in advance. 


  • December 17, 2010
  • Like
  • 0

I need to populate some picklist value on an Opportunity Trigger. 

 

There are two pickList : 'PickList 1' and 'PickList2' . 2nd one  is dependent on the earlier.When I populate PickList1 on the trigger, how can I get the relevent value of 'PickList2' ?

 

Any help will be appreciated . Thanks in Advance!

  • December 03, 2010
  • Like
  • 0

I want to create a new clone button that doesn't poplulate all the fields of the standard clone button. Does anyone have the apex code behind the standard one that I can copy and modify?