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 add the Product details for opportunity using trigger

how to automatically added the products(opportunity lineitem) 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...............................


vishal@forcevishal@force

I am confused about one thing. Product details? Is that a field on Opportunity? 

sdfasdsdfasd

thanks for your post Vishal.  No is  not a field in opportunity. i.e Product Standard object.