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;
}
}
}