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
sdfasdsdfasd 

how to automatically add the product details to each opportunity using trigger

how to automatically add the product details to each opportunity using trigger  . pls help me

nagalakshminagalakshmi

Hi,

 

Can you explain me clearly. You need to add each new product to every opportunity?????

 

Thanks

sdfasdsdfasd

Thank for your post Nagalakshmi. ok i will explain 

 

how to automatically added the product details based on condtion.

in Opporutnity i created 2Fields i.e

                                                                1.ServiceType (Picklist datatype   Required)

                                                                2.ContractLengthmonth(Text datatype Required).

 

1.ServiceType picklist contain National,International,NotProvider values

 

i created some products in product object. like international service 01months , International Service 03months and International Service 06 month. each product contain pricebooks.

 

Now i fills the Opportunity information in opporutnity that time i select the International value from ServiceType picklist  and  i fills  the 3 in ContractLengthmonth Field. after i click on save button  then automatically added the Prodcut details  i.e  Internation Service 03months like this. 

 

samelike i select the International value from ServiceType picklist and i fills the 2 in ContractLengthmonth field after i click on save button then automatically  added the product details. i.e International Service 02months product name. how can create the trigger for this task please help me...............................