Skip to main content

Trying to write trigger on Order item .I have created new field called discount.I have to perform formula using trigger on TotalPrice (TotalPrice = Discount * TotalPrice)(TotalPrice=Discount*TotalPrice). II am not able to access TotalPrice hence getting this error "Innvalid field TotalPrice for SObject OrderItem " Not understanding how to access TotalPrice fields .

 trigger Totalprice on OrderItem (after insert,after update)  {
      if(trigger.isafter && trigger.isupdate){
           for(OrderItem oi : trigger.new) {
              Oi.TotalPrice =  Oi.Discount__cTotalPrice= * Oi.Discount__c*Oi.TotalPrice;
          }   }
     }   }
 }

Trying to write trigger on Order item .I have created new field called discount.I have to perform formula using trigger on TotalPrice (TotalPrice = Discount * TotalPrice). I am not able to access TotalPrice hence getting this error "Innvalid field TotalPrice for SObject OrderItem " Not understanding how to access TotalPrice fields .

trigger Totalprice on OrderItem (after insert,after update)  {
     if(trigger.isafter && trigger.isupdate){
          for(OrderItem oi : trigger.new) {
              Oi.TotalPrice =  Oi.Discount__c * Oi.TotalPrice;
          }   
     }   
}

Trying to write trigger on Order item .I have created new field called discount.I have to perform formula using trigger on TotalPrice(TotalPrice=Discount*TotalPrice).I am not able to access TotalPrice hence getting this error "Innvalid field TotalPrice for SObject OrderItem " Not understanding how to access TotalPrice fields .

 trigger Totalprice on OrderItem (after insert,after update)  {
      if(trigger.isafter && trigger.isupdate){
           for(OrderItem oi : trigger.new) {
               Oi.TotalPrice=  Oi.Discount__c*Oi.TotalPrice;
           }
      }
 }
added 35 characters in body
Source Link
Boris Bachovski
  • 16.3k
  • 8
  • 50
  • 88

Trying to write trigger on Order item .I have created new field called discount.I have to perform formula using trigger on TotalPrice(TotalPrice=Discount*TotalPrice) (TotalPrice = Discount * TotalPrice).I I am not able to access TotalPrice hence getting this error "Innvalid field TotalPrice for SObject OrderItem " Not understanding how to access TotalPrice fields .

trigger Totalprice on OrderItem (after insert,after update) { if(trigger.isafter && trigger.isupdate){ for(OrderItem oi : trigger.new) { Oi.TotalPrice= Oi.Discount__c*Oi.TotalPrice; } } }

trigger Totalprice on OrderItem (after insert,after update)  {
     if(trigger.isafter && trigger.isupdate){
          for(OrderItem oi : trigger.new) {
              Oi.TotalPrice =  Oi.Discount__c * Oi.TotalPrice;
          }   
     }   
}

Trying to write trigger on Order item .I have created new field called discount.I have to perform formula using trigger on TotalPrice(TotalPrice=Discount*TotalPrice).I am not able to access TotalPrice hence getting this error "Innvalid field TotalPrice for SObject OrderItem " Not understanding how to access TotalPrice fields .

trigger Totalprice on OrderItem (after insert,after update) { if(trigger.isafter && trigger.isupdate){ for(OrderItem oi : trigger.new) { Oi.TotalPrice= Oi.Discount__c*Oi.TotalPrice; } } }

Trying to write trigger on Order item .I have created new field called discount.I have to perform formula using trigger on TotalPrice (TotalPrice = Discount * TotalPrice). I am not able to access TotalPrice hence getting this error "Innvalid field TotalPrice for SObject OrderItem " Not understanding how to access TotalPrice fields .

trigger Totalprice on OrderItem (after insert,after update)  {
     if(trigger.isafter && trigger.isupdate){
          for(OrderItem oi : trigger.new) {
              Oi.TotalPrice =  Oi.Discount__c * Oi.TotalPrice;
          }   
     }   
}
Source Link

Not able to access TotalPrice in OrderItem

Trying to write trigger on Order item .I have created new field called discount.I have to perform formula using trigger on TotalPrice(TotalPrice=Discount*TotalPrice).I am not able to access TotalPrice hence getting this error "Innvalid field TotalPrice for SObject OrderItem " Not understanding how to access TotalPrice fields .

trigger Totalprice on OrderItem (after insert,after update) { if(trigger.isafter && trigger.isupdate){ for(OrderItem oi : trigger.new) { Oi.TotalPrice= Oi.Discount__c*Oi.TotalPrice; } } }