You need to sign in to do that
Don't have an account?

i got a task on trigger.i created an object called data and created two fields one is country a picklist and and fee.i want to give discount on fee base on country value.i am getting error as condition expression must be type of boolean:string .plz help
this is my code
trigger trg12 on data__c (before insert) {
list<data__c>stu=trigger.new;
for(data__c s:trigger.new){
if(s.country__c='usa') {
double p;
p=s.fee__c*0.2;
s.fee__c =s.fee__c - p;
}
}
trigger trg12 on data__c (before insert) {
list<data__c>stu=trigger.new;
for(data__c s:trigger.new){
if(s.country__c='usa') {
double p;
p=s.fee__c*0.2;
s.fee__c =s.fee__c - p;
}
}
Please try this
trigger trg12 on data__c (before insert) {
for(data__c s:trigger.new){
double p;
if(s.country__c=='usa') {
p=s.fee__c*0.2;
s.fee__c =s.fee__c - p;
}
}
}
All Answers
Please try this
trigger trg12 on data__c (before insert) {
for(data__c s:trigger.new){
double p;
if(s.country__c=='usa') {
p=s.fee__c*0.2;
s.fee__c =s.fee__c - p;
}
}
}