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
alok29novalok29nov 

Populating Opportunity field from a custom object

Hi All,

 

I have a requirement where I need to create  a formula field on opportunity object which reefrs to other custom object.

 

Let me explain it in detail. I have a custom object called Booking quota which has booking amount for different users/Opportunity owners. It is like below one.Let say there are three opportunity user A, B, C.

My object Booking Quota has details like this:

 

Booking Quota



(Opportunity Owner)         Amount



A                                          $100000

B                                          $120000

C                                          $180000

 

Now I have these different opportunity owners on opportunity page. I want to create a formula on opportunity object field let say Booking Amount which populates $100000 if opportunity owner is A and $120000 in case of B.

 

Please tell me how this can be achieved.

 

Thanks

~Alok

crop1645crop1645

Alok:

 

You need:

 

1. A lookup field on Opportunity to Booking Quota

2. A cross-object formula field to reference the lookup relationship Booking_quota__r.amount

 

Your trick will be how to default the value of the lookup field to the ID field of the Booking_Quota__c objectId.  This is best done with an APEX trigger on Opportunity