You need to sign in to do that
Don't have an account?
Gauri Gaikwad 13
datatype error in apex class
hi, i am trying to add trigger & apex code i am getting error as (Error: Compile Error: Invalid type: Pen_c at line 3 column 51).
code in apex class----------------------
Public Class PenClassDemonstration{
public static void ApplyDiscountPen (List< Pen_c >VarPensListNew){
For(Pen_c VarP: VarPensListNew){
if(VarP.Price_c>= 100){
VarP.Price_c= VarP.Price_c- 20;
}
}
}
}
code in apex class----------------------
Public Class PenClassDemonstration{
public static void ApplyDiscountPen (List< Pen_c >VarPensListNew){
For(Pen_c VarP: VarPensListNew){
if(VarP.Price_c>= 100){
VarP.Price_c= VarP.Price_c- 20;
}
}
}
}
All Answers
try with below code.
If this helps, Please mark it as best answer.
Thanks!!
Error: Compile Error: Invalid type: Pen__c at line 3 column 53
Can you share the apex trigger code?
trigger PropertyDiscountTrigger on Property_c(before update) {
PropertyClassDemonstration.ApplyDiscountProperty(Trigger.New);
}
Thank you so much