You need to sign in to do that
Don't have an account?
Nagraj Naik 4
public Class PenClassDemonstration {
public static void ApplyDiscountPen(list<Pen__c> VarPenListNew) {
for(Pen__c VarP : VarPenListNew){
if(VarP.Price__c >= 100){
VarP.Price__c = VarP.Price__c-20;
}
}
}
}
Compile Error: Invalid type: Pen__c at line 3 column 58
public Class PenClassDemonstration {
public static void ApplyDiscountPen(list<Pen__c> VarPenListNew) {
for(Pen__c VarP : VarPenListNew){
if(VarP.Price__c >= 100){
VarP.Price__c = VarP.Price__c-20;
}
}
}
}
Please use below code
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Mukesh you just changed the variable name I don't this is the right solution.
Nagraj checks for the object correct field name and object name.
your code is looking good. you can refresh the dev console again and just try to reSave and make sure your objectApiName or FieldName And field type are correct.
let me know about your solution if my solution is helpful to you then mark it as best answer.
Thank you
1.Please refresh your dev console resave your code.
2.Change your variables name.
3.Check objName and feild name.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Suraj
did you try above solution if it helps then mark it as best answer so that it could be help to others.
thank you