You need to sign in to do that
Don't have an account?
Prachi Vijayvargiya
Error in compiling
Hi This is my code.
trigger trigger1 on Record__c(before insert,before update){
for(Record__c r:Trigger.new){
if(r.Room_Type__c==Single Room){
r.Discount_Per__c='5';
}
}
}
And the error i am getting is Compile Error: Extra ')', at 'Room'. at line 3 column 28.
Can someone help.
trigger trigger1 on Record__c(before insert,before update){
for(Record__c r:Trigger.new){
if(r.Room_Type__c==Single Room){
r.Discount_Per__c='5';
}
}
}
And the error i am getting is Compile Error: Extra ')', at 'Room'. at line 3 column 28.
Can someone help.
Make the Single Room surrounded with single quotes as below
if(r.Room_Type__c== 'Single Room')
{
r.Discount_Per__c='5';
}
I tried and it gave an error again.
I then removed "5" from quotes and it worked.
Thanks a lot:)