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
Eric VitucciEric Vitucci 

When entering a value on an opportunity I need to update fields from a custom object back to the Opportunity.

I am new to writing apex triggers and trying to figure out how I can do this. I have a custom object called Pricing Table, what I need to do is when the Number of users is selected on the Opportunity object that it pulls the data from the following fields on the custom object, Base Price, Price Per User and User Price. I have User setup as a lookup field  between the Opportunity and the custom object, but I can't for the life of me figure out how to populate the fields on the opportunity. I have tried making them formula's but I don't see the custom object. Since the formula fields don't work I am looking to try and write my first trigger and was hoping some of you can point me in the right direction on how I can do this.

Thanks,
Eric
EldonEldon
Hi Eric your req are not clear pls make tell little more details like what do you mean by selecting no of users on opp. Also do you have look up on custom obj and opp to user object? And when do you exactly want to populate those fields on to opp?