function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MayankAdmMayankAdm 

Create Opportunity under the Contact

Hi All,

 

I am trying to creating opportunity under the contact through apex basically In opportunity there no direct relationship with contact it will direct refer to contact Account

 

when i am creating opportunity and passing account id and other mandatory information than opportunity will create under the that account 

 

so, How is it possible to create opportunity under the contact related list 

 

Thanks,

Mayank

Vinit_KumarVinit_Kumar

Mayank,

 

I think you will have to create a Lookup relationship between contact and opportunity.

MayankAdmMayankAdm
Thanks Vinit ,

But there no other option basically i don't want to create lookup

Jeff MayJeff May

If you don't want to create a custom field to link objects that are not related, your choices are very limited. You could, for example, use the ContactRoles object and add a record that has the Opp.Id and the Contact.Id.   But that is much more complicated than just adding a Lookup(Contact) field to the Opp.