• Pedro Reyes
  • 0 Points
  • Member since 2022

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 1
Hi all!!
How can I create a visual for page that contains all details about the last order and send by email when status order change to closed won.

Hi!!!! How can I add a bonus product in order using a custom decision table and triggers  (e.g if an order have a specific client, address and total add a specific bonus product of a custom object decision table)
I am trying to add one order product as default whenever a custom field in Order Object (Service_Type__c) is Postpaid. I am stuck at below step. Please help to complete the same as to how can I insert product name, code etc.

trigger createlineitems on Order (after insert) {
    list<Orderitem> lineitems = new list<Orderitem>();
    for (Order o : trigger.new){
        if(o.Service_Type__c == 'Postpaid')
            Orderitem oitem = new Orderitem();
              oitem.OrderId = o.id;
           oitem.Quantity = 1;
            oitem.UnitPrice = 200;
  oitem.PricebookEntryId =?????
     insert lineitems;