Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Apex Code Development
- :
- Re: Invalid field fee for SObject student__c at li...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Invalid field fee for SObject student__c at line 8 column 11
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-05-2013 06:17 AM
trigger newinsert on student__C(before insert)
{
list<student__c>st_list=trigger.new;
for(student__c st:st_list)
{
if(st.country__C='india')
{
st.fee__C=st.fee-st.fee__c*0.1;
}
if(st.country__C='us')
{
st.fee__C=st.fee-st.fee__c*0.2;
}
if(st.country__C='uk')
{
st.fee__c=st.fee-st.fee__c*0.3;
}
else
{
st.fee__c=st.fee-st.fee__C*0.05;
}
}
}
Re: Invalid field fee for SObject student__c at line 8 column 11
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-05-2013 06:30 AM
Looking at your code "st.fee" is invalid. Please use st.fee__c when doing the calculation.
Kartik Viswanadha | Force.com Developer | @logontokartik | http://peregrinusforce.com
Re: Invalid field fee for SObject student__c at line 8 column 11
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-05-2013 06:31 AM
Try with this code,
trigger newinsert on student__C(before insert){
for(student__c st:trigger.new){
if(st.country__C='india') { st.fee__C=st.fee__c-st.fee__c*0.1; }
if(st.country__C='us') { st.fee__C=st.fee-st.fee__c*0.2; }
if(st.country__C='uk') { st.fee__c=st.fee-st.fee__c*0.3; }
else { st.fee__c=st.fee-st.fee__C*0.05; }
}
}

