Skip to main content
Melissa Cook a posé une question dans #Email
I'm trying to create an Order Confirmation and Shipping Confirmation email template.  From the Oppoturnities fields I can select all that I want and the fields show up just fine.  However I'm trying to get the product, producty qty and product price and every type of product field available isn't the one I'm looking for.  There are no price book options so beyond creating my own custom fields in the oppoturnity and making duplicate fields that I can pull into the email template, is there another way to do it?
1 réponse
  1. 27 juil. 2018, 16:18
    Hi, What I understand from your ques is you are not able to get Product record(with their fields i.e. Quantity and Price) from Opportunity record. 

     

    Maybe, You are trying to fetch Product fields from trigger on Opportunity. If you are doing that, you need explicitly query from product record as from Opportunity record you wont get any other related record expect Oppotunity itself.

     

    You can query like:-

     

    List<OpportunityLineItem> products = [Select Id,Quantity, TotalPrice from OpportunityLineItem where OpportunityId = :opp];

     

    Also, I am not able to understand "There are no price book options" line. 

     

    Hope this helps you.
0/9000