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
andersalandersal 

Problem with getting all products from opportunities to a custom object for a contact

Hi!

 

I wonder if there is someone that can help me with a problem. I want to create a custom object portfolio. which should be on the  contact tab. That task is ok. Now I want to fill this object with items from the opportunities object. The data from the opportunities object is the products which are selected. This should happen when the user add product in the opportunity, then it should automatically add to the portfolio object. I know I should use triggers here, but I am not excactly sure how to start. I want to add a line for each product for each opportunity for a given contact. Such that all products for the contact is in one place. It should be like the productlisting in opportunities but now all productlistings for all opportunities.

 

Is there someone which can help me? At least get me started? I am e newbie here so I need to get som help to get the grip on this.

Shilpa_SFShilpa_SF

 

Hi,

 

   You have to write a trigger (after insert) on Opportunity Production object  and based on the opportunityproductid you can retrieve the opportunity details also, You can then insert in to Custom object portfolio.

 

   Below links helps you in writing the apex code:

 

    www.salesforce.com/.../salesforce_apex_language_reference.pdf

    http://www.developerforce.com/events/forcedotcomcookbook/registration.php

 

tantotanto

Do you have any programming experience?

andersalandersal

Hi!

 

Yes I have some. But I am completely new to this. And I am in a hurry to set up salesforce for my company. So I needed some help to start with, just for getting the grip of it.

tantotanto

You can drop me an email if you would like to discuss in more depth.