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
- :
- Please help to resolve my trigger problem
turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
0
Please help to resolve my trigger problem
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-10-2012 02:45 AM
Hi,
In below trigger while updation of record i am checking the new expiration date and old expiration date and if they are not equal then i am updating the field Record_Support_Expiration_Date_Sub_Text1__c but what is the problem its not working
trigger UpdateoldExpirationdateonChange on Record_Support__c (Before update) {
try {
List<Record_Support__c updateList = new List<Record_Support__c>();
for (Integer i = 0; i < Trigger.new.size( ); i++) {
if (Trigger.new[i].Expiration_Date__c != Trigger.old[i].Expiration_Date__c) {
System.debug('-------old[i].Expira tion_Date__c------------' +Trigger.old[i].Expirati on_Date__c);
System.debug('-------new[i].Expir ation_Date__c------------' +Trigger.new[i].Expirat ion_Date__c);
Trigger.new[i].Record_Support_Expi ration_Date_Sub_Text1__c=Trigger.old[i].Expiration _Date__c; //remove credit card entries prior to co mmitting data to Salesforce
System.debug('------- Trigger.new [i].Record_Support_Expiration_Date_Sub_Text1__c--- ---------' + Trigger.new[i].Record_Support_Expirat ion_Date_Sub_Text1__c);
updateList.add(Trigger.new[i]);
}
}
update updateList;
} catch(Exception e) {
// System.Debug('removeCCValue Trigger failed : '+e.getMessage()); //write error to the debug lo g
}
}Thanks in advance:))))
0
Re: Please help to resolve my trigger problem
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-10-2012 06:23 AM
Hi Satyam
what is the error?

