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
sriphani ramakasriphani ramaka 

Create a trigger to populate account value on Proposal record from opportunity (only on create proposal)can anyone give me trigger for this

v varaprasadv varaprasad
Hi Sriphani,

Please check once below sample code : 
Trigger updateProposal on proposal_c(Before insert){
  set<id> oppIds = new set<id>();
  for(proposal_c pro :{
      if(pro.opportunity__C != null){
  Map<id,opportunity> oppmap = new   Map<id,opportunity> ([slect id,name,accountid, from opportunity where id in : oppIds]);
  //Use above map and add field to proposal
  for(proposal_c pro :{
   //EX = oppmap.get(pro.opportunity__C);


You can use process builder for the above functionality.

Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.

Salesforce Freelance Consultant/Developer/Administrator/Trainer
@For Salesforce Project Support:

Salesforce latest interview questions and training videos :

If you have any projects in Salesforce regarding my knowledge, I will happy to work with you.

My contact Details are listed below.

V Varaprasad
Mobile No :+91 9393934143