-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
37Questions
-
46Replies
Got Following Error Please help me
Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 0019000001j60UNAAY; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30190000000D90w. Contact your administrator for help.: []
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 0019000001j60UNAAY; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30190000000D90w. Contact your administrator for help.: []
- Jagadeesh Adaveni
- July 22, 2016
- Like
- 0
ApexPages.message(ApexPages.severity.ERROR,'Please select Box to save'));) gets fired need some error sound
Hi,
I have Apexpage messages in my controller, when my page message(ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select Box to save'));) gets fired need some error sound.
How can i do this?
please give me any suggestions
Thanks,
A.Jagadees.
I have Apexpage messages in my controller, when my page message(ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select Box to save'));) gets fired need some error sound.
How can i do this?
please give me any suggestions
Thanks,
A.Jagadees.
- Jagadeesh Adaveni
- April 21, 2016
- Like
- 0
Need Error Sound when i am getting error on visualforce page
Hi,
I have Apexpage messages in my controller, when my page message gets fired need some error sound.
How can i do this?
please give me any suggestions
Thanks,
A.Jagadees.
I have Apexpage messages in my controller, when my page message gets fired need some error sound.
How can i do this?
please give me any suggestions
Thanks,
A.Jagadees.
- Jagadeesh Adaveni
- April 20, 2016
- Like
- 0
Getting error too many BCC addresses,
Hi All,
I'm getting error like
too many BCC addresses,
How can i resolve it.
I'm getting error like
too many BCC addresses,
How can i resolve it.
public PageReference send() { List < String > emailTo = new List < String >(); List < String > emailCc = new List < String >(); List< document > documentList=[select name from document where Name='logo']; emailTo.clear(); emailCc.clear(); stud = [select id, Name, Parent_Alternative_Email_ID__c, Parent_Email__c, Category__c from Student__c where Category__c = : selectcat]; for (student__c std: stud) { if(std.Parent_Email__c !=null) emailTo.add(std.Parent_Email__c); if(std.Parent_Alternative_Email_ID__c !=null) emailCc.add(std.Parent_Alternative_Email_ID__c); } List<Messaging.SingleEmailMessage> mails= new List<Messaging.SingleEmailMessage>(); Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage(); semail.setBccAddresses(emailTo); semail.setCcAddresses(emailCc); semail.setSubject(subject); semail.setHtmlBody(body); mails.add(semail); if(!mails.isEmpty()){ if(!semail.BccAddresses.isEmpty()){ Messaging.sendEmail(mails); ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email has been sent'); ApexPages.addMessage(myMsg); } else{ ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.WARNING, 'No Students are availble for selecting Category'); ApexPages.addMessage(myMsg); } } mails.clear(); subject=''; body=''; selectcat=''; return null; }
- Jagadeesh Adaveni
- April 01, 2016
- Like
- 0
Getting error System.DmlException: Insert failed. First exception on row 0 with id a04f0000006YpZ9AAK; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
public class logView3Controller { public Boolean searched { get; set; } public List<Weeks__c> weekList = Weeks__c.getAll().values(); public Map<Integer, Weeks__c> weekMap = new Map<Integer, Weeks__c>(); public Map<String, Integer> weekMapGetIntWithWeek = new Map<String, Integer>(); public Map<String, Subjects_and_Levels__c> subjectLevelMap = Subjects_and_Levels__c.getAll(); public List<Subjects_and_Levels__c> subjectLevelList = subjectLevelMap.values(); public Map<String, Subjects_and_Levels__c> levelMap = new Map<String, Subjects_and_Levels__c>(); public Date StartDate {get;set;} public Date EndDate {get;set;} public String selectedLocation {get;set;} public String selectedDay {get;set;} public List<Log_Book__c> logBookEntries {get;set;} public List<studentsWithWeeks> studentsWithWeeksList {get;set;} public studentsWithWeeks newSWW {get;set;} public String domain {get;set;} public List<integer> indexNums {get;set;} public List<String> weekTableHeader {get;set;} public List<String> subjectTableHeader {get;set;} public List<Log_Book__c> relatedLogs{get;set;} //Jagadeesh public String selectedTeacher{get;set;} public String selectedDays{get;set;} public Id recordToUpdateId {get;set;} public Id recordToUpdateIdStudent {get;set;} public log_Book__c logObj {get;set;} public Student__c studentObj {get;set;} public boolean displayPopup {get; set;} public boolean displayPopupStudent {get; set;} public String exportToExcelURL {get;set;} public log_Book__c newLevel{get;set;} public log_Book__c newWeek{get;set;} List<Log_Book__c> lbjump{get;set;} // 2. a,b,c,d - a,j,k,l,m - changing the complete series // Written by Jagadeesh(New code for skip records) public List<Log_Book__c> jump{get;set;} public Log_Book__c jump1{get;set;} public List<Log_Book__c> lblist{get;set;} List<Log_Book__c> updateLogs = new List<Log_Book__c>(); public logView3Controller () { domain = ApexPages.currentPage().getHeaders().get('Host'); //exportToExcelURL = '/apex/logView3ExportToExcel?startDate='+startDate+'&endDate='+endDate+'&selectedLocation='+selectedLocation; exportToExcelURL = '/apex/logView3ExportToExcel?startDate='+startDate+'&endDate='+endDate+'&selectedLocation='+selectedLocation+'&selectedTeacher='+selectedTeacher; weekTableHeader = new List<String>(); relatedLogs = new List<Log_book__c>(); searched = false; } public String getEnglishColor() { return Colr; } public PageReference doUpdateLogObj2() { String lv = logObj.Week__c.split('-')[0]; if(logObj.Subject__c == 'Math' && logObj.Level__c == 'Level 5B' && Integer.valueOf(lv) > 17){ logObj.Week__c.addError('For Math Level 5B week should not exceed 17'); return null; } system.debug('hii'); relatedLogs = [SELECT Id FROM Log_Book__c WHERE Student__r.Id =: logObj.Student__r.Id AND Subject__c =: logObj.Subject__c AND Class_Scheduled_Date__c >=: logObj.Class_Scheduled_Date__c and isSkipped__c=false]; System.debug(' relatedLogs.Size()'+ relatedLogs.Size()); Log_Book__c lb = new Log_Book__c(); Integer levelOrder = Integer.valueof(subjectLevelMap.get(logObj.Subject__c +':'+logObj.Level__c).Order__c); Integer weekOrder; System.Debug('levelOrder :' + levelOrder); System.Debug('weekList :' + weekList); for(Weeks__c week : weekList) { weekMap.put((Integer)week.Order__c, week); weekMapGetIntWithWeek.put(week.Name, (Integer)week.Order__c); } System.Debug('weekMap :' + weekMap); System.Debug('weekMapGetIntWithWeek :'+ weekMapGetIntWithWeek); for(Subjects_and_Levels__c level: subjectLevelList) { levelMap.put(level.subject__c+Integer.valueof(level.Order__c), level); } System.Debug('levelMap :' + levelMap); Integer totalLevels = 0; if(logObj.Subject__c == 'English') totalLevels = 16; else if(logObj.Subject__c == 'Abacus') totalLevels = 11; else if(logObj.Subject__c == 'Math') totalLevels = 14; else if(logObj.Subject__c == 'G.K') totalLevels = 3; System.Debug('Total Logs :'+ relatedLogs.Size()); lb = logObj.clone(false, true, false, false); updateLogs.add(lb); for(Integer i=1; i<relatedLogs.Size(); i++) { lb = new Log_Book__c(); System.Debug('lblblblblblblb :' + lb); lb = updateLogs[i-1].clone(false, true, false, false); weekOrder = Integer.ValueOf(weekMapGetIntWithWeek.get(lb.Week__c)); System.Debug('weekOrder : ' + weekOrder); lb.Class_Scheduled_Date__c = lb.Class_Scheduled_Date__c.addDays(7); System.Debug('weekMapGetIntWithWeek.get(lb.Week__c) :'+ weekMapGetIntWithWeek.get(lb.Week__c)); System.Debug('weekMapGetIntWithWeek.get(lb.Week__c)+i :'+ Integer.ValueOf(weekMapGetIntWithWeek.get(lb.Week__c))+i); if( weekOrder < 26 ) { weekOrder = weekOrder+1; lb.Week__c = weekMap.get(weekOrder).Name; System.Debug('@@@@@@ lb.Week__c = ' + lb.Week__c); } else { if(lb.week__c == '26-Z') { if(levelOrder < totalLevels) { levelOrder = levelOrder +1; System.Debug('lb.Subject__c+levelOrder : '+ lb.Subject__c+levelOrder); lb.level__c = levelMap.get(lb.Subject__c+levelOrder).Level__c; lb.Week__c = '1-A'; } } else if(lb.Subject__c == 'Math' && lb.Level__c == 'Level 5B' && lb.Week__c == '17-Q') { if(levelOrder != null && levelOrder < totalLevels){ levelOrder = levelOrder +1; lb.level__c = levelMap.get(lb.Subject__c+levelOrder).Level__c; lb.Week__c = '1-A'; } } else { i = relatedLogs.Size(); } } System.Debug('lblblblblblblb :' + lb); updateLogs.add(lb); System.Debug('updateLogs : '+ updateLogs); } System.debug('--->related logs are--->'+relatedLogs); delete relatedLogs; System.debug('--->related logs are after delete--->'+relatedLogs); insert updateLogs; //insertLogs(); System.debug('@@@@@updated logs@@@'+updateLogs.size()+'----------->'+updateLogs[0]); displayPopup = false; doSearch(); return null; } /*public void deleteLogs() { if(relatedLogs.size()>0 && relatedLogs!=null){ System.debug('@@@@@relatedlogs@@@'+relatedLogs.size()); try{ delete relatedLogs; } catch(exception e) { ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error,e.getMessage())); } } } public void insertLogs() { if(updateLogs.size()>0 && updateLogs!=null){ System.debug('@@@@@relatedlogs@@@'+relatedLogs.size()); try{ insert updateLogs; }catch(exception e) { ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error,e.getMessage())); } } }*/ public void closePopup() { displayPopup = false; } public void closePopupStudent() { displayPopupStudent = false; } public void showPopup() { logObj = new log_Book__c(); try { system.debug('recordToUpdateId : '+recordToUpdateId); logObj = [SELECT Id, Name,Start_Time__c,End_Time__c, Color_Code__c, Comment_on_LogBook__c, Subjects_Registered__c, Student__c, Student__r.Id, Student__r.Color_Code__c, Student__r.Name, Student__r.Last_Name__c, Subject__c, Level__c, Week__c, Week_Day__c, Class_Scheduled_Date__c,Subjects_Registered__r.Teacher__c, Student__r.Location__r.Name FROM Log_Book__c WHERE Id =:recordToUpdateId ]; system.debug('old name : '+logObj.Name+' old week : '+logObj.Week__c+' old Level : '+logObj.Level__c+' id '+logObj.id); system.debug('teacher name '+logObj.Subjects_Registered__r.Teacher__c); } catch(exception e) { System.Debug(e.getMessage()); } displayPopup = true; } public void showPopupForStudent() { studentObj = new Student__c(); try { studentObj = [SELECT Id, Color_Code__c, Comment_on_LogBook__c, Name, Last_Name__c FROM Student__c WHERE Id =:recordToUpdateIdStudent]; } catch(exception e) { System.Debug(e.getMessage()); } displayPopupStudent = true; }
- Jagadeesh Adaveni
- March 01, 2016
- Like
- 0
Unable to Delete Records using APEX????
Hi All,
I have written one Apex controller in that i wrote logic for delete and update. Problem here is am unable to delete records.
Thanks,
A.Jagadeesh
I have written one Apex controller in that i wrote logic for delete and update. Problem here is am unable to delete records.
public class logView3Controller { public Boolean searched { get; set; } public List<Weeks__c> weekList = Weeks__c.getAll().values(); public Map<Integer, Weeks__c> weekMap = new Map<Integer, Weeks__c>(); public Map<String, Integer> weekMapGetIntWithWeek = new Map<String, Integer>(); public Map<String, Subjects_and_Levels__c> subjectLevelMap = Subjects_and_Levels__c.getAll(); public List<Subjects_and_Levels__c> subjectLevelList = subjectLevelMap.values(); public Map<String, Subjects_and_Levels__c> levelMap = new Map<String, Subjects_and_Levels__c>(); public Date StartDate {get;set;} public Date EndDate {get;set;} public String selectedLocation {get;set;} public String selectedDay {get;set;} public List<Log_Book__c> logBookEntries {get;set;} public List<studentsWithWeeks> studentsWithWeeksList {get;set;} public studentsWithWeeks newSWW {get;set;} public String domain {get;set;} public List<integer> indexNums {get;set;} public List<String> weekTableHeader {get;set;} public List<String> subjectTableHeader {get;set;} public List<Log_Book__c> relatedLogs{get;set;} //Jagadeesh public String selectedTeacher{get;set;} public String selectedDays{get;set;} public Id recordToUpdateId {get;set;} public Id recordToUpdateIdStudent {get;set;} public log_Book__c logObj {get;set;} public Student__c studentObj {get;set;} public boolean displayPopup {get; set;} public boolean displayPopupStudent {get; set;} public String exportToExcelURL {get;set;} public log_Book__c newLevel{get;set;} public log_Book__c newWeek{get;set;} List<Log_Book__c> lbjump{get;set;} // 2. a,b,c,d - a,j,k,l,m - changing the complete series // Written by Jagadeesh(New code for skip records) public List<Log_Book__c> jump{get;set;} public Log_Book__c jump1{get;set;} public List<Log_Book__c> lblist{get;set;} List<Log_Book__c> updateLogs = new List<Log_Book__c>(); public logView3Controller () { domain = ApexPages.currentPage().getHeaders().get('Host'); //exportToExcelURL = '/apex/logView3ExportToExcel?startDate='+startDate+'&endDate='+endDate+'&selectedLocation='+selectedLocation; exportToExcelURL = '/apex/logView3ExportToExcel?startDate='+startDate+'&endDate='+endDate+'&selectedLocation='+selectedLocation+'&selectedTeacher='+selectedTeacher; weekTableHeader = new List<String>(); relatedLogs = new List<Log_book__c>(); searched = false; } public String getEnglishColor() { return Colr; } public PageReference doUpdateLogObj2() { String lv = logObj.Week__c.split('-')[0]; if(logObj.Subject__c == 'Math' && logObj.Level__c == 'Level 5B' && Integer.valueOf(lv) > 17){ logObj.Week__c.addError('For Math Level 5B week should not exceed 17'); return null; } system.debug('hii'); relatedLogs = [SELECT Id, Name, Color_Code__c, Comment_on_LogBook__c, Student__c, Student__r.Id, Student__r.Name, Student__r.Last_Name__c, Subject__c, Level__c, Week__c, Week_Day__c, Class_Scheduled_Date__c, Student__r.Location__r.Name FROM Log_Book__c WHERE Student__r.Id =: logObj.Student__r.Id AND Subject__c =: logObj.Subject__c AND Class_Scheduled_Date__c >=: logObj.Class_Scheduled_Date__c and isSkipped__c=false]; System.debug(' relatedLogs.Size()'+ relatedLogs.Size()); Log_Book__c lb = new Log_Book__c(); Integer levelOrder = Integer.valueof(subjectLevelMap.get(logObj.Subject__c +':'+logObj.Level__c).Order__c); Integer weekOrder; System.Debug('levelOrder :' + levelOrder); System.Debug('weekList :' + weekList); for(Weeks__c week : weekList) { weekMap.put((Integer)week.Order__c, week); weekMapGetIntWithWeek.put(week.Name, (Integer)week.Order__c); } System.Debug('weekMap :' + weekMap); System.Debug('weekMapGetIntWithWeek :'+ weekMapGetIntWithWeek); for(Subjects_and_Levels__c level: subjectLevelList) { levelMap.put(level.subject__c+Integer.valueof(level.Order__c), level); } System.Debug('levelMap :' + levelMap); Integer totalLevels = 0; if(logObj.Subject__c == 'English') totalLevels = 16; else if(logObj.Subject__c == 'Abacus') totalLevels = 11; else if(logObj.Subject__c == 'Math') totalLevels = 14; else if(logObj.Subject__c == 'G.K') totalLevels = 3; System.Debug('Total Logs :'+ relatedLogs.Size()); lb = logObj.clone(false, true, false, false); updateLogs.add(lb); for(Integer i=1; i<relatedLogs.Size(); i++) { lb = new Log_Book__c(); System.Debug('lblblblblblblb :' + lb); lb = updateLogs[i-1].clone(false, true, false, false); weekOrder = Integer.ValueOf(weekMapGetIntWithWeek.get(lb.Week__c)); System.Debug('weekOrder : ' + weekOrder); lb.Class_Scheduled_Date__c = lb.Class_Scheduled_Date__c.addDays(7); System.Debug('weekMapGetIntWithWeek.get(lb.Week__c) :'+ weekMapGetIntWithWeek.get(lb.Week__c)); System.Debug('weekMapGetIntWithWeek.get(lb.Week__c)+i :'+ Integer.ValueOf(weekMapGetIntWithWeek.get(lb.Week__c))+i); if( weekOrder < 26 ) { weekOrder = weekOrder+1; lb.Week__c = weekMap.get(weekOrder).Name; System.Debug('@@@@@@ lb.Week__c = ' + lb.Week__c); } else { if(lb.week__c == '26-Z') { if(levelOrder < totalLevels) { levelOrder = levelOrder +1; System.Debug('lb.Subject__c+levelOrder : '+ lb.Subject__c+levelOrder); lb.level__c = levelMap.get(lb.Subject__c+levelOrder).Level__c; lb.Week__c = '1-A'; } } else if(lb.Subject__c == 'Math' && lb.Level__c == 'Level 5B' && lb.Week__c == '17-Q') { if(levelOrder != null && levelOrder < totalLevels){ levelOrder = levelOrder +1; lb.level__c = levelMap.get(lb.Subject__c+levelOrder).Level__c; lb.Week__c = '1-A'; } } else { i = relatedLogs.Size(); } } System.Debug('lblblblblblblb :' + lb); updateLogs.add(lb); System.Debug('updateLogs : '+ updateLogs); } delete relatedLogs; update updateLogs; //insertLogs(); System.debug('@@@@@updated logs@@@'+updateLogs.size()+'----------->'+updateLogs[0]); displayPopup = false; return null; } }
Thanks,
A.Jagadeesh
- Jagadeesh Adaveni
- February 25, 2016
- Like
- 0
Getting error "Attempt to dereference null" in Batch apex.
Hi All,
I am getting error as Attempt to dereference null while am running batch apex. Could you please resolve it
Below is my code
Thanks,
Jagadeesh
I am getting error as Attempt to dereference null while am running batch apex. Could you please resolve it
Below is my code
global class batchLogBookManagementV2 implements Database.Batchable<sObject> { global List<Log_Book__c> logToBeContinued = new List<Log_Book__c> (); global List<Log_Book__c> logToBeInserted = new List<Log_Book__c> (); global List<Subject_Registered__c> sbsr = new List<Subject_Registered__c> (); global List<Weeks__c> weekList = Weeks__c.getAll().values(); global Map<Integer, Weeks__c> weekMap = new Map<Integer, Weeks__c>(); global Map<String, Integer> weekMapGetIntWithWeek = new Map<String, Integer>(); global Map<String, Subjects_and_Levels__c> subjectLevelMap = Subjects_and_Levels__c.getAll(); global List<Subjects_and_Levels__c> subjectLevelList = subjectLevelMap.values(); global Map<String, Subjects_and_Levels__c> levelMap = new Map<String, Subjects_and_Levels__c>(); global final String query = 'SELECT id, Last_Schedule__c, Level__c, Student__c, Subject__c, Week__c, (SELECT Student__c, Subjects_Registered__c, Subject__c, Class_Scheduled_Date__c, Level__c, Week__c FROM Log_Books__r ORDER By Class_Scheduled_Date__c DESC NULLS FIRST LIMIT 1 ) FROM Subject_Registered__c WHERE Deactivated__c = false AND Last_Schedule__c != null'; global Iterable<sObject> start(Database.BatchableContext BC){ sbsr = Database.query(query); for(Subject_Registered__c s: sbsr) { logToBeContinued.add(s.log_Books__r[0]); } return logToBeContinued; } global void execute(Database.BatchableContext BC,List<Log_Book__c> scope){ for(Subjects_and_Levels__c level: subjectLevelList) { system.debug('level : '+level); if(level !=null) levelMap.put(level.subject__c+Integer.valueof(level.Order__c), level); else system.debug('error as level null'); } for(Weeks__c week : weekList) { system.debug('week : '+week); if(week != null){ weekMap.put((Integer)week.Order__c, week); weekMapGetIntWithWeek.put(week.Name, (Integer)week.Order__c); } } System.debug('++++++++++++++++++++++++ : ' + scope); for(Log_Book__c s: scope) { System.debug('logToBeInserted-------------------------------- : ' + logToBeInserted.size()); System.debug('-------------------------------- : ' + s); Integer totalLevels = 0; if(s.Subject__c == 'English') totalLevels = 16; else if(s.Subject__c == 'Abacus') totalLevels = 11; else if(s.Subject__c == 'Math') totalLevels = 14; else if(s.Subject__c == 'G.K') totalLevels = 3; System.debug('xxxxxxxxxxxxxxxx : ' + subjectLevelMap); //System.debug('@@Subject@@@@@@@'+subjectLevelMap.get(s.Subject__c+s.level__c)); Integer levelOrder = Integer.valueof(subjectLevelMap.get(s.Subject__c +':'+s.Level__c).Order__c); system.debug('level order: '+levelOrder); Integer weekOrder = Integer.ValueOf(weekMapGetIntWithWeek.get(s.Week__c)); system.debug('week order: '+weekOrder); Log_Book__c l = new Log_Book__c (); l.Student__c = s.Student__c; l.Subject__c = s.Subject__c; l.Subjects_Registered__c = s.Subjects_Registered__c; l.Class_Scheduled_Date__c = s.Class_Scheduled_Date__c.addDays(7); if(s.Week__c == '26-Z') { if(levelOrder < totalLevels) { levelOrder = levelOrder +1; System.Debug('lb.Subject__c+levelOrder : '+ l.Subject__c+levelOrder); l.level__c = levelMap.get(l.Subject__c+levelOrder).Level__c; l.Week__c = '1-A'; logToBeInserted.add(l); } } else if(s.Subject__c == 'Math' && s.Level__c == 'Level 5B' && s.Week__c == '17-Q') { if(levelOrder < totalLevels) { levelOrder = levelOrder +1; System.Debug('lb.Subject__c+levelOrder : '+ l.Subject__c+levelOrder); l.level__c = levelMap.get(l.Subject__c+levelOrder).Level__c; l.Week__c = '1-A'; logToBeInserted.add(l); } } else { weekOrder = weekOrder+1; l.Week__c = weekMap.get(weekOrder).Name; l.Level__c = s.Level__c; logToBeInserted.add(l); } } if(logToBeInserted.size()>0) { Database.SaveResult[] srList = Database.insert(logToBeInserted, false); // Iterate through each returned result for (Database.SaveResult sr : srList) { if (sr.isSuccess()) { // Operation was successful, so get the ID of the record that was processed System.debug('Successfully inserted LogBook. LogBook ID: ' + sr.getId()); } else { // Operation failed, so get all errors for(Database.Error err : sr.getErrors()) { System.debug('The following error has occurred.'); System.debug(err.getStatusCode() + ': ' + err.getMessage()); System.debug('Account fields that affected this error: ' + err.getFields()); } } } } // System.debug('############################### :' + ((Subject_Registered__c)scope.get(0)).log_Book__r.Class_Scheduled_Date__c); // scope variable now has the records received from QueryLocator. // delete scope; // Database.emptyRecycleBin(scope); } global void finish(Database.BatchableContext BC){ AsyncApexJob a = [SELECT Id, Status, NumberOfErrors, JobItemsProcessed, TotalJobItems, CreatedBy.Email FROM AsyncApexJob WHERE Id =:BC.getJobId()]; // Send an email to the Apex job's submitter // notifying of job completion. Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); String[] toAddresses = new String[] {a.CreatedBy.Email}; mail.setToAddresses(toAddresses); mail.setSubject('BAtch: ' + a.Status); mail.setPlainTextBody('The batch Apex job processed ' + a.TotalJobItems +' batches with '+ a.NumberOfErrors + ' failures.'); Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); } }Below are my custom settings
Thanks,
Jagadeesh
- Jagadeesh Adaveni
- February 22, 2016
- Like
- 0
I have account object.. I want to show all its child objects in another adjusent column
Hi all,
I have Parent objects.. I want to show all its child objects in another adjusent column based on parent selection. For this i have used Dynamic Schema.
With Dynamic schema i am able to get all parent objects into picklist but unable to get childs.
Please help me out.
Thanks,
A.Jagadeesh
I have Parent objects.. I want to show all its child objects in another adjusent column based on parent selection. For this i have used Dynamic Schema.
With Dynamic schema i am able to get all parent objects into picklist but unable to get childs.
Please help me out.
Thanks,
A.Jagadeesh
- Jagadeesh Adaveni
- December 18, 2015
- Like
- 0
How to get QR code value into our salesforce system???
Hi All,
I have orders, were generated by users and for every product we have QR code and code will scan using scanner or mobile app, when ever we scan that QR code that value should store into salesforce system. it is very urgent please help me out.
Thanks,
A.JAgadeesh.
I have orders, were generated by users and for every product we have QR code and code will scan using scanner or mobile app, when ever we scan that QR code that value should store into salesforce system. it is very urgent please help me out.
Thanks,
A.JAgadeesh.
- Jagadeesh Adaveni
- November 10, 2015
- Like
- 0
"The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page."
Hi All,
When i am trying to update(Page is VF page) my record am getting error in Production saying that 'DATA NOT AVAILABLE' "The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page." Please Help me out
Thanks,
A.Jagadeesh
When i am trying to update(Page is VF page) my record am getting error in Production saying that 'DATA NOT AVAILABLE' "The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page." Please Help me out
Thanks,
A.Jagadeesh
- Jagadeesh Adaveni
- November 03, 2015
- Like
- 1
Unable to perform update operation?
Hi All,
I have written one triiger , it is performing deletion but unable to perform update. I did not get any error also
Thanks,
Jagadeesh
I have written one triiger , it is performing deletion but unable to perform update. I did not get any error also
trigger reScheduleLogBooks on Log_Book__c (after update) { Set<String> subjects = new Set<String>(); Set<String> students = new Set<String>(); Set<id> set1 = new Set<id>(); List<Log_Book__c> lbDelList = new List<Log_Book__c>(); List<Log_Book__c> lbdl = new List<Log_Book__c>(); Set<String> weeks = new Set<String>(); List<Weeks__c> weekList = Weeks__c.getAll().values(); Map<Integer,weeks__c> weekMap = new Map<Integer,weeks__c>(); List<Log_Book__c> listToUpdate = new List<Log_Book__c>(); List<Log_Book__c> lstToAdd = new List<Log_Book__c>(); Set<Log_Book__c> setLog = new Set<Log_Book__c>(); for(weeks__c week : weekList) { weekMap.put((Integer)week.Order__c,week); } for(Log_Book__c lbook : Trigger.old) { set1.add(lbook.Id); subjects.add(lbook.Subject__c); students.add(lbook.Student__c); } lbdl=[select Abacus__c, Absent_Time_Stamp__c, Absent__c, Attended__c, Class_Scheduled_Date__c, Collected_Book__c, Comments__c, Do_Not_Promote__c, English__c, Level__c, Order__c, Reason__c, Id, Student__c, Subject__c, Subjects_Registered__c, Week__c, Week_Day__c, gk__c, math__c from log_book__c where id in: set1 AND Subject__c in: subjects AND Student__c in: students ]; for(Log_Book__c lbdelete : lbdl) { if(lbdelete.Class_Scheduled_Date__c>System.Today()) { lbDelList.add(lbdelete); system.debug('@@@@@@@@@@Deleted Record is@@@@@@'+lbDelList); } } if(lbDelList.size()>0 && lbDelList!=null) { delete lbDelList; } if(stoprecursive.trigger1==true) { stoprecursive.trigger1=false; for(Log_Book__c lbUpdate : Trigger.new) { weeks.add(lbUpdate.week__c); subjects.add(lbUpdate.Subject__c); students.add(lbUpdate.Student__c); } for(Log_Book__c lbup : [select Abacus__c, Absent_Time_Stamp__c, Absent__c, Attended__c, Class_Scheduled_Date__c, Collected_Book__c, Comments__c, Do_Not_Promote__c, English__c, Level__c, Order__c, Reason__c, Id, Student__c, Subject__c, Subjects_Registered__c, Week__c, Week_Day__c, gk__c, math__c from log_book__c where subject__c IN: subjects AND Student__c IN: students AND week__c IN: weeks AND Class_Scheduled_Date__c >=: system.today() order by order__c]) { Integer weekLevel = 0; String[] weekLevels = lbup.Week__c.split('-'); //will get only week number of week__c field of Log_Book__c object selected value will store in first index weekLevel = Integer.valueof(weekLevels[0]); if(lbup.Class_Scheduled_Date__c >= System.Today()) { for(Integer j=weekLevel;j<27;j++) { lbup.Class_Scheduled_Date__c = lbup.Class_Scheduled_Date__c.addDays(7); //assigning custom setting value to week__c field based on selected week number from log_book__c object lbup.week__c = weekMap.get(weekLevel).name; system.debug('*************'+lbup.Class_Scheduled_Date__c + lbup.Level__c + lbup.Week__c); //lstToAdd.add(lbup); lstToAdd.add(lbup); weekLevel++; } //lstToAdd.add(lbup); weekLevel = 1; } } setLog.addAll(lstToAdd); listToUpdate.addAll(setLog); } //stoprecursive.trigger1=true; //delete lbDelList; update listToUpdate;
Thanks,
Jagadeesh
- Jagadeesh Adaveni
- February 18, 2015
- Like
- 0
execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.editGenerateLogbooks: line 55, column 1
Hi All,
I am getting following error in my trigger.
execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.editGenerateLogbooks: line 55, column 1
Could you please resolve it.
Thanks
A.Jagadeesh
I am getting following error in my trigger.
execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.editGenerateLogbooks: line 55, column 1
Could you please resolve it.
trigger editGenerateLogbooks on Log_Book__c (after update) { Set<id> set1 = new Set<id>(); Set<String> weeks = new Set<String>(); Set<String> subjects = new Set<String>(); Set<String> students = new Set<String>(); List<Weeks__c> weekList = Weeks__c.getAll().values(); List<Log_Book__c> lb = new List<Log_Book__c>(); List<Log_Book__c> lbDelList = new List<Log_Book__c>(); List<Log_Book__c> lstToUpdate = new List<Log_Book__c>(); //Map for Custom setting object Map<Integer,weeks__c> weekMap = new Map<Integer,weeks__c>(); List<Log_Book__c> lstToAdd = new List<Log_Book__c>(); Set<Log_Book__c> setLog = new Set<Log_Book__c>(); for(weeks__c week : weekList) { weekMap.put((Integer)week.Order__c,week); } for(Log_Book__c lbook : Trigger.old) { set1.add(lbook.Id); } lb=[select Abacus__c, Absent_Time_Stamp__c, Absent__c, Attended__c, Class_Scheduled_Date__c, Collected_Book__c, Comments__c, Do_Not_Promote__c, English__c, Level__c, Order__c, Reason__c, Id, Student__c, Subject__c, Subjects_Registered__c, Week__c, Week_Day__c, gk__c, math__c from log_book__c where id in: set1]; for(Log_Book__c lbdelete : lb) { if(lbdelete.Class_Scheduled_Date__c == System.today()) { lbDelList.add(lbdelete); system.debug('@@@@@@@@@@Deleted Record is@@@@@@'+lbDelList); } } for(Log_Book__c lbUpdate : Trigger.new) { weeks.add(lbUpdate.week__c); subjects.add(lbUpdate.Subject__c); students.add(lbUpdate.Student__c); } for(Log_Book__c lbup : [select Abacus__c, Absent_Time_Stamp__c, Absent__c, Attended__c, Class_Scheduled_Date__c, Collected_Book__c, Comments__c, Do_Not_Promote__c, English__c, Level__c, Order__c, Reason__c, Id, Student__c, Subject__c, Subjects_Registered__c, Week__c, Week_Day__c, gk__c, math__c from log_book__c where subject__c IN: subjects AND Student__c IN: students AND week__c IN: weeks AND Class_Scheduled_Date__c >=: system.today() order by order__c]) { Integer weekLevel = 0; String[] weekLevels = lbup.Week__c.split('-'); //will get only week number of week__c field of Log_Book__c object selected value will store in first index weekLevel = Integer.valueof(weekLevels[0]); if(lbup.week__c != Trigger.oldMap.get(lbup.id).week__c || lbup.Class_Scheduled_Date__c >= System.Today()) { for(Integer j=weekLevel;j<27;j++) { system.debug('++hiiiiiiiiiii+'); lbup.Class_Scheduled_Date__c = lbup.Class_Scheduled_Date__c.addDays(7); //assigning custom setting value to week__c field based on selected week number fromlog_book__c object lbup.week__c = weekMap.get(weekLevel).name; system.debug('*****Jagadeesh********'+lbup.Class_Scheduled_Date__c + lbup.Level__c + lbup.Week__c); //lstToAdd.add(lbup); weekLevel++; } lstToAdd.add(lbup); weekLevel = 1; } } setLog.addAll(lstToAdd); lstToUpdate.addAll(setLog); update lstToUpdate; }
Thanks
A.Jagadeesh
- Jagadeesh Adaveni
- February 17, 2015
- Like
- 0
Why i am getting following Error while i am updating Record?
Hi All,
May i know that Why i am getting following Error while i am updating Record?
But in Debug logs i am getting values that what i want to update. Could you please change my trigger.
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger editGenerateLogbooks caused an unexpected exception, contact your administrator: editGenerateLogbooks: execution of AfterUpdate caused by: System.ListException: Duplicate id in list: a04f0000005HAXyAAO: Trigger.editGenerateLogbooks: line 68, column 1
May i know that Why i am getting following Error while i am updating Record?
But in Debug logs i am getting values that what i want to update. Could you please change my trigger.
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger editGenerateLogbooks caused an unexpected exception, contact your administrator: editGenerateLogbooks: execution of AfterUpdate caused by: System.ListException: Duplicate id in list: a04f0000005HAXyAAO: Trigger.editGenerateLogbooks: line 68, column 1
trigger editGenerateLogbooks on Log_Book__c (after update) { Set<id> set1 = new Set<id>(); Set<String> weeks = new Set<String>(); Set<String> subjects = new Set<String>(); Set<String> students = new Set<String>(); List<Weeks__c> weekList = Weeks__c.getAll().values(); List<Log_Book__c> lb = new List<Log_Book__c>(); List<Log_Book__c> lbDelList = new List<Log_Book__c>(); List<Log_Book__c> lstToUpdate = new List<Log_Book__c>(); Map<Integer,weeks__c> weekMap = new Map<Integer,weeks__c>(); for(weeks__c week : weekList) { weekMap.put((Integer)week.Order__c,week); } for(Log_Book__c lbook : Trigger.old) { set1.add(lbook.Id); } lb=[select Abacus__c, Absent_Time_Stamp__c, Absent__c, Attended__c, Class_Scheduled_Date__c, Collected_Book__c, Comments__c, Do_Not_Promote__c, English__c, Level__c, Order__c, Reason__c, Id, Student__c, Subject__c, Subjects_Registered__c, Week__c, Week_Day__c, gk__c, math__c from log_book__c where id in: set1]; for(Log_Book__c lbdelete : lb) { if(lbdelete.Class_Scheduled_Date__c >= System.today()) { lbDelList.add(lbdelete); } } for(Log_Book__c lbUpdate : Trigger.new) { weeks.add(lbUpdate.week__c); subjects.add(lbUpdate.Subject__c); students.add(lbUpdate.Student__c); } for(Log_Book__c lbup : [select Abacus__c, Absent_Time_Stamp__c, Absent__c, Attended__c, Class_Scheduled_Date__c, Collected_Book__c, Comments__c, Do_Not_Promote__c, English__c, Level__c, Order__c, Reason__c, Id, Student__c, Subject__c, Subjects_Registered__c, Week__c, Week_Day__c, gk__c, math__c from log_book__c where subject__c IN: subjects AND Student__c IN: students AND week__c IN: weeks AND Class_Scheduled_Date__c >=: system.today() order by order__c]) { String[] weekLevels = lbup.Week__c.split('-'); Integer weekLevel = Integer.valueof(weekLevels[0]); if(lbup.week__c != Trigger.oldMap.get(lbup.id).week__c || lbup.Class_Scheduled_Date__c >= System.Today()) { for(Integer j=weekLevel;j<27;j++) { system.debug('++hiiiiiiiiiii+'); lbup.Class_Scheduled_Date__c = lbup.Class_Scheduled_Date__c.addDays(7); lbup.week__c = weekMap.get(weekLevel).name; system.debug('*****Jagadeesh********'+lbup.Class_Scheduled_Date__c + lbup.Level__c + lbup.Week__c); lstToUpdate.add(lbup); weekLevel++; } weekLevel = 1; } } delete lbDelList; update lstToUpdate; }
- Jagadeesh Adaveni
- February 16, 2015
- Like
- 0
Autonumber Generation
Hi All,
I have two field calld TrackingNumber__c(Text) and Status__c, My requirement is whenever staus field is updated as"Supplied" then one Track Number should be generated automatically. How can i achieve. Give me sample code if it is required.
Thanks,
Jagadeesh.
I have two field calld TrackingNumber__c(Text) and Status__c, My requirement is whenever staus field is updated as"Supplied" then one Track Number should be generated automatically. How can i achieve. Give me sample code if it is required.
Thanks,
Jagadeesh.
- Jagadeesh Adaveni
- February 03, 2015
- Like
- 0
How to display Edit page Picklist value in Detail page?
Hi All,
I have two visualforce pages(Editpage one VF and Detail page one VF) for one object.
In Editpage VF i have created one Dynamic Picklist and after saving my page that Picklist is not available in Detail page of VF. Shall what changes i do in Detail Page.
Thanks
Jagadeesh
I have two visualforce pages(Editpage one VF and Detail page one VF) for one object.
In Editpage VF i have created one Dynamic Picklist and after saving my page that Picklist is not available in Detail page of VF. Shall what changes i do in Detail Page.
Editmode VF page ------------------------- <apex:pageblockSectionItem > <apex:outputLabel >Payment Mode</apex:outputLabel> <apex:selectList value="{!svalue}" size="1"> <apex:actionsupport event="onchange" action="{!picklistPB}" /> <apex:selectOptions Value="{!picklistFunction}"></apex:selectOptions> </apex:selectList> </apex:pageblockSectionItem> Controller --------------- public List<selectOption> getpicklistFunction() { List<selectOption> studentName =new List<selectOption>(); List<Student__c> studentList = new List<Student__c>(); List<Student__c> stuList = [select id,name,Payment_mode__c,Location__c,Location__r.Payment_mode__c from Student__c where id =: ApexPages.currentPage().getParameters().get('id')]; studentName.add(new selectOption('--None--','--None--')); for(Student__c st : stuList) { st.payment_mode__c = st.Location__r.Payment_Mode__c; if(st.Location__r.Payment_Mode__c=='ACH;Check;Credit Card') { studentName.add(new selectOption('Check','Check')); studentName.add(new selectOption('Credit Card','Credit Card')); studentName.add(new selectOption('ACH','ACH')); } else{ if(st.Location__r.Payment_Mode__c=='Check;Credit Card'){ studentName.add(new selectOption('Check','Check')); studentName.add(new selectOption('Credit Card','Credit Card'));} else { if(st.Location__r.Payment_Mode__c=='ACH;Credit Card'){ studentName.add(new selectOption('ACH','ACH')); studentName.add(new selectOption('Credit Card','Credit Card'));} else { if(st.Location__r.Payment_Mode__c=='ACH;Check'){ studentName.add(new selectOption('ACH','ACH')); studentName.add(new selectOption('Check','Check'));} else { if(st.Location__r.Payment_Mode__c=='ACH') studentName.add(new selectOption('ACH','ACH')); else { if(st.Location__r.Payment_Mode__c=='Check') studentName.add(new selectOption('Check','Check')); else { if(st.Location__r.Payment_Mode__c=='Credit Card') studentName.add(new selectOption('Credit Card','Credit Card')); } } } } } } } return studentName ; } public PageReference picklistPB() { if(svalue.contains('Credit Card')) studentAcceptsCC = true; else studentAcceptsCC = false; if(svalue.contains('ACH')) studentAcceptsACH = true; else studentAcceptsACH = false; if(svalue.contains('Check')) studentAcceptsCheck = true; else studentAcceptsCheck = false; return null; }
Thanks
Jagadeesh
- Jagadeesh Adaveni
- January 28, 2015
- Like
- 0
Could you please help me it is urgent requirement. Problem with Picklist values
I have Location and student objects are there. In Location object multiselect picklist paymentmode is there with values(ACH,Check,Cash) and student is lookup to location and even in Student i have picklist called paymentmode with values(ACH,Check,Cash).
Requirement is Whatever the values i selected in Location only those values should appear in student. I tried following code but it is not working
Requirement is Whatever the values i selected in Location only those values should appear in student. I tried following code but it is not working
VisualforcePage ---------------------- <apex:inputField value="{!Student__c.Payment_Mode__c}"> <apex:actionSupport event="onchange" action="{!picklistFunction}"/> </apex:inputField> Controller -------------- public PageReference picklistFunction() { List<Student__c> studentList = new List<Student__c>(); List<Student__c> stuList = [select id,name,Payment_mode__c,Location__c,Location__r.Payment_mode__c from Student__c]; for(Student__c st : stuList) { st.payment_mode__c = st.Location__r.Payment_Mode__c; studentList.add(st); } update studentList; return null; }
- Jagadeesh Adaveni
- January 26, 2015
- Like
- 0
Could you Please help me it looks too urgent.. How to render block based picklist value selection
Hi All,
I have Payment_Mode__c Multiselect picklist field with values (ACH,Check,Credit Card) in Location__C object.
I have Student__c object is lookup to Location__c, here i have created picklist in VF with values ACH,Check,Credit Card.
Requirement is in Student Object if i select any picklist value like Check then Check related block need to rendered.
Check Block is like BankName: Check Number: etc fields need to rendered.
Thanks,
Jagadeesh.
I have Payment_Mode__c Multiselect picklist field with values (ACH,Check,Credit Card) in Location__C object.
I have Student__c object is lookup to Location__c, here i have created picklist in VF with values ACH,Check,Credit Card.
VF page ------------- <apex:selectList value="{!svalue}" size="1"> <apex:outputLabel value="{!$ObjectType.Student__c.fields.Payment_Mode__c.label}"></apex:outputLabel> <apex:selectOptions Value="{!picklistFunction}"></apex:selectOptions> </apex:selectList> Controller ---------------public list<student__c> studentList{get;set;} public list<selectoption> lstoption{get;set;} public String sValue{get;set;} public List<selectOption> getpicklistFunction() { List<selectOption> studentName =new List<selectOption>(); List<Student__c> studentList = new List<Student__c>(); List<Student__c> stuList = [select id,name,Payment_mode__c,Location__c,Location__r.Payment_mode__c from Student__c where name='Shiva 1']; for(Student__c st : stuList) { st.payment_mode__c = st.Location__r.Payment_Mode__c; system.debug('------------>'+st.payment_mode__c+'<---------------'); if(st.Location__r.Payment_Mode__c.contains('Check')) studentName.add(new selectOption('Check','Check')); if(st.Location__r.Payment_Mode__c.contains('Credit Card')) studentName.add(new selectOption('Credit Card','Credit Card')); if(st.Location__r.Payment_Mode__c.contains('ACH')) studentName.add(new selectOption('ACH','ACH')); studentList.add(st); } return studentName ; } Output is ------------- Payment Mode(ACH,Check)(because i selected these values in Location__c)
Requirement is in Student Object if i select any picklist value like Check then Check related block need to rendered.
Check Block is like BankName: Check Number: etc fields need to rendered.
Thanks,
Jagadeesh.
- Jagadeesh Adaveni
- January 26, 2015
- Like
- 0
Can you please help me out?
Hi All,
I have Location and student objects are there. In Location object multiselect picklist paymentmode is there with values(ACH,Check,Cash) and student is lookup to location and even in Student i have picklist called paymentmode with values(ACH,Check,Cash).
Requirement is Whatever the values i selected in Location only those values should appear in student. I tried following code but it is not working
I have Location and student objects are there. In Location object multiselect picklist paymentmode is there with values(ACH,Check,Cash) and student is lookup to location and even in Student i have picklist called paymentmode with values(ACH,Check,Cash).
Requirement is Whatever the values i selected in Location only those values should appear in student. I tried following code but it is not working
VisualforcePage ---------------------- <apex:inputField value="{!Student__c.Payment_Mode__c}"> <apex:actionSupport event="onchange" action="{!picklistFunction}"/> </apex:inputField> Controller -------------- public PageReference picklistFunction() { List<Student__c> studentList = new List<Student__c>(); List<Student__c> stuList = [select id,name,Payment_mode__c,Location__c,Location__r.Payment_mode__c from Student__c]; for(Student__c st : stuList) { st.payment_mode__c = st.Location__r.Payment_Mode__c; studentList.add(st); } update studentList; return null; }
- Jagadeesh Adaveni
- January 23, 2015
- Like
- 0
How to Populate Parent object picklist selected values on child object picklist?
Hi All,
I have Parent object with multiselect picklist(CC,ACH,Cash,Check).
I have Child Object picklist with same values. Here Student Edit and Detail pages are Visualforce pages.
Requirement is Whatever the picklist values selected in Parent object those values only be populated on Child object and remainig values should not be visible. I tried with following Code but remaining values are visible.
Thanks
Jagadeesh
I have Parent object with multiselect picklist(CC,ACH,Cash,Check).
I have Child Object picklist with same values. Here Student Edit and Detail pages are Visualforce pages.
Requirement is Whatever the picklist values selected in Parent object those values only be populated on Child object and remainig values should not be visible. I tried with following Code but remaining values are visible.
Controller: -------------- String parenturl = apexPages.currentPage().getParameters().get('retURL'); parenturl .trim(); if(parenturl .contains('/')) { parenturl = parent .subString(1); } Id locIdId = Id.valueOf(parent url); child.multiselect__c = child.Parent__r.picklist__c;
Thanks
Jagadeesh
- Jagadeesh Adaveni
- January 22, 2015
- Like
- 0
Could you please sort out this issue?
Hi All,
Hi I hv text encrypted field(Size 16 digits) in one object, now i want to insert data using dataloader, problem here is in csv file one cell allow exactly 15 digits only if i enter 16 digits last digit it shows '0' how can i insert? if i take text it allows but after saving the file and try to reopened that file it shows 4.15E+123 etc how can i do?
Thanks
Jagadeesh
Hi I hv text encrypted field(Size 16 digits) in one object, now i want to insert data using dataloader, problem here is in csv file one cell allow exactly 15 digits only if i enter 16 digits last digit it shows '0' how can i insert? if i take text it allows but after saving the file and try to reopened that file it shows 4.15E+123 etc how can i do?
Thanks
Jagadeesh
- Jagadeesh Adaveni
- January 07, 2015
- Like
- 0
"The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page."
Hi All,
When i am trying to update(Page is VF page) my record am getting error in Production saying that 'DATA NOT AVAILABLE' "The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page." Please Help me out
Thanks,
A.Jagadeesh
When i am trying to update(Page is VF page) my record am getting error in Production saying that 'DATA NOT AVAILABLE' "The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page." Please Help me out
Thanks,
A.Jagadeesh
- Jagadeesh Adaveni
- November 03, 2015
- Like
- 1
Got Following Error Please help me
Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 0019000001j60UNAAY; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30190000000D90w. Contact your administrator for help.: []
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 0019000001j60UNAAY; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30190000000D90w. Contact your administrator for help.: []
- Jagadeesh Adaveni
- July 22, 2016
- Like
- 0
ApexPages.message(ApexPages.severity.ERROR,'Please select Box to save'));) gets fired need some error sound
Hi,
I have Apexpage messages in my controller, when my page message(ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select Box to save'));) gets fired need some error sound.
How can i do this?
please give me any suggestions
Thanks,
A.Jagadees.
I have Apexpage messages in my controller, when my page message(ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please select Box to save'));) gets fired need some error sound.
How can i do this?
please give me any suggestions
Thanks,
A.Jagadees.
- Jagadeesh Adaveni
- April 21, 2016
- Like
- 0
Getting error too many BCC addresses,
Hi All,
I'm getting error like
too many BCC addresses,
How can i resolve it.
I'm getting error like
too many BCC addresses,
How can i resolve it.
public PageReference send() { List < String > emailTo = new List < String >(); List < String > emailCc = new List < String >(); List< document > documentList=[select name from document where Name='logo']; emailTo.clear(); emailCc.clear(); stud = [select id, Name, Parent_Alternative_Email_ID__c, Parent_Email__c, Category__c from Student__c where Category__c = : selectcat]; for (student__c std: stud) { if(std.Parent_Email__c !=null) emailTo.add(std.Parent_Email__c); if(std.Parent_Alternative_Email_ID__c !=null) emailCc.add(std.Parent_Alternative_Email_ID__c); } List<Messaging.SingleEmailMessage> mails= new List<Messaging.SingleEmailMessage>(); Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage(); semail.setBccAddresses(emailTo); semail.setCcAddresses(emailCc); semail.setSubject(subject); semail.setHtmlBody(body); mails.add(semail); if(!mails.isEmpty()){ if(!semail.BccAddresses.isEmpty()){ Messaging.sendEmail(mails); ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email has been sent'); ApexPages.addMessage(myMsg); } else{ ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.WARNING, 'No Students are availble for selecting Category'); ApexPages.addMessage(myMsg); } } mails.clear(); subject=''; body=''; selectcat=''; return null; }
- Jagadeesh Adaveni
- April 01, 2016
- Like
- 0
Getting error System.DmlException: Insert failed. First exception on row 0 with id a04f0000006YpZ9AAK; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
public class logView3Controller { public Boolean searched { get; set; } public List<Weeks__c> weekList = Weeks__c.getAll().values(); public Map<Integer, Weeks__c> weekMap = new Map<Integer, Weeks__c>(); public Map<String, Integer> weekMapGetIntWithWeek = new Map<String, Integer>(); public Map<String, Subjects_and_Levels__c> subjectLevelMap = Subjects_and_Levels__c.getAll(); public List<Subjects_and_Levels__c> subjectLevelList = subjectLevelMap.values(); public Map<String, Subjects_and_Levels__c> levelMap = new Map<String, Subjects_and_Levels__c>(); public Date StartDate {get;set;} public Date EndDate {get;set;} public String selectedLocation {get;set;} public String selectedDay {get;set;} public List<Log_Book__c> logBookEntries {get;set;} public List<studentsWithWeeks> studentsWithWeeksList {get;set;} public studentsWithWeeks newSWW {get;set;} public String domain {get;set;} public List<integer> indexNums {get;set;} public List<String> weekTableHeader {get;set;} public List<String> subjectTableHeader {get;set;} public List<Log_Book__c> relatedLogs{get;set;} //Jagadeesh public String selectedTeacher{get;set;} public String selectedDays{get;set;} public Id recordToUpdateId {get;set;} public Id recordToUpdateIdStudent {get;set;} public log_Book__c logObj {get;set;} public Student__c studentObj {get;set;} public boolean displayPopup {get; set;} public boolean displayPopupStudent {get; set;} public String exportToExcelURL {get;set;} public log_Book__c newLevel{get;set;} public log_Book__c newWeek{get;set;} List<Log_Book__c> lbjump{get;set;} // 2. a,b,c,d - a,j,k,l,m - changing the complete series // Written by Jagadeesh(New code for skip records) public List<Log_Book__c> jump{get;set;} public Log_Book__c jump1{get;set;} public List<Log_Book__c> lblist{get;set;} List<Log_Book__c> updateLogs = new List<Log_Book__c>(); public logView3Controller () { domain = ApexPages.currentPage().getHeaders().get('Host'); //exportToExcelURL = '/apex/logView3ExportToExcel?startDate='+startDate+'&endDate='+endDate+'&selectedLocation='+selectedLocation; exportToExcelURL = '/apex/logView3ExportToExcel?startDate='+startDate+'&endDate='+endDate+'&selectedLocation='+selectedLocation+'&selectedTeacher='+selectedTeacher; weekTableHeader = new List<String>(); relatedLogs = new List<Log_book__c>(); searched = false; } public String getEnglishColor() { return Colr; } public PageReference doUpdateLogObj2() { String lv = logObj.Week__c.split('-')[0]; if(logObj.Subject__c == 'Math' && logObj.Level__c == 'Level 5B' && Integer.valueOf(lv) > 17){ logObj.Week__c.addError('For Math Level 5B week should not exceed 17'); return null; } system.debug('hii'); relatedLogs = [SELECT Id FROM Log_Book__c WHERE Student__r.Id =: logObj.Student__r.Id AND Subject__c =: logObj.Subject__c AND Class_Scheduled_Date__c >=: logObj.Class_Scheduled_Date__c and isSkipped__c=false]; System.debug(' relatedLogs.Size()'+ relatedLogs.Size()); Log_Book__c lb = new Log_Book__c(); Integer levelOrder = Integer.valueof(subjectLevelMap.get(logObj.Subject__c +':'+logObj.Level__c).Order__c); Integer weekOrder; System.Debug('levelOrder :' + levelOrder); System.Debug('weekList :' + weekList); for(Weeks__c week : weekList) { weekMap.put((Integer)week.Order__c, week); weekMapGetIntWithWeek.put(week.Name, (Integer)week.Order__c); } System.Debug('weekMap :' + weekMap); System.Debug('weekMapGetIntWithWeek :'+ weekMapGetIntWithWeek); for(Subjects_and_Levels__c level: subjectLevelList) { levelMap.put(level.subject__c+Integer.valueof(level.Order__c), level); } System.Debug('levelMap :' + levelMap); Integer totalLevels = 0; if(logObj.Subject__c == 'English') totalLevels = 16; else if(logObj.Subject__c == 'Abacus') totalLevels = 11; else if(logObj.Subject__c == 'Math') totalLevels = 14; else if(logObj.Subject__c == 'G.K') totalLevels = 3; System.Debug('Total Logs :'+ relatedLogs.Size()); lb = logObj.clone(false, true, false, false); updateLogs.add(lb); for(Integer i=1; i<relatedLogs.Size(); i++) { lb = new Log_Book__c(); System.Debug('lblblblblblblb :' + lb); lb = updateLogs[i-1].clone(false, true, false, false); weekOrder = Integer.ValueOf(weekMapGetIntWithWeek.get(lb.Week__c)); System.Debug('weekOrder : ' + weekOrder); lb.Class_Scheduled_Date__c = lb.Class_Scheduled_Date__c.addDays(7); System.Debug('weekMapGetIntWithWeek.get(lb.Week__c) :'+ weekMapGetIntWithWeek.get(lb.Week__c)); System.Debug('weekMapGetIntWithWeek.get(lb.Week__c)+i :'+ Integer.ValueOf(weekMapGetIntWithWeek.get(lb.Week__c))+i); if( weekOrder < 26 ) { weekOrder = weekOrder+1; lb.Week__c = weekMap.get(weekOrder).Name; System.Debug('@@@@@@ lb.Week__c = ' + lb.Week__c); } else { if(lb.week__c == '26-Z') { if(levelOrder < totalLevels) { levelOrder = levelOrder +1; System.Debug('lb.Subject__c+levelOrder : '+ lb.Subject__c+levelOrder); lb.level__c = levelMap.get(lb.Subject__c+levelOrder).Level__c; lb.Week__c = '1-A'; } } else if(lb.Subject__c == 'Math' && lb.Level__c == 'Level 5B' && lb.Week__c == '17-Q') { if(levelOrder != null && levelOrder < totalLevels){ levelOrder = levelOrder +1; lb.level__c = levelMap.get(lb.Subject__c+levelOrder).Level__c; lb.Week__c = '1-A'; } } else { i = relatedLogs.Size(); } } System.Debug('lblblblblblblb :' + lb); updateLogs.add(lb); System.Debug('updateLogs : '+ updateLogs); } System.debug('--->related logs are--->'+relatedLogs); delete relatedLogs; System.debug('--->related logs are after delete--->'+relatedLogs); insert updateLogs; //insertLogs(); System.debug('@@@@@updated logs@@@'+updateLogs.size()+'----------->'+updateLogs[0]); displayPopup = false; doSearch(); return null; } /*public void deleteLogs() { if(relatedLogs.size()>0 && relatedLogs!=null){ System.debug('@@@@@relatedlogs@@@'+relatedLogs.size()); try{ delete relatedLogs; } catch(exception e) { ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error,e.getMessage())); } } } public void insertLogs() { if(updateLogs.size()>0 && updateLogs!=null){ System.debug('@@@@@relatedlogs@@@'+relatedLogs.size()); try{ insert updateLogs; }catch(exception e) { ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error,e.getMessage())); } } }*/ public void closePopup() { displayPopup = false; } public void closePopupStudent() { displayPopupStudent = false; } public void showPopup() { logObj = new log_Book__c(); try { system.debug('recordToUpdateId : '+recordToUpdateId); logObj = [SELECT Id, Name,Start_Time__c,End_Time__c, Color_Code__c, Comment_on_LogBook__c, Subjects_Registered__c, Student__c, Student__r.Id, Student__r.Color_Code__c, Student__r.Name, Student__r.Last_Name__c, Subject__c, Level__c, Week__c, Week_Day__c, Class_Scheduled_Date__c,Subjects_Registered__r.Teacher__c, Student__r.Location__r.Name FROM Log_Book__c WHERE Id =:recordToUpdateId ]; system.debug('old name : '+logObj.Name+' old week : '+logObj.Week__c+' old Level : '+logObj.Level__c+' id '+logObj.id); system.debug('teacher name '+logObj.Subjects_Registered__r.Teacher__c); } catch(exception e) { System.Debug(e.getMessage()); } displayPopup = true; } public void showPopupForStudent() { studentObj = new Student__c(); try { studentObj = [SELECT Id, Color_Code__c, Comment_on_LogBook__c, Name, Last_Name__c FROM Student__c WHERE Id =:recordToUpdateIdStudent]; } catch(exception e) { System.Debug(e.getMessage()); } displayPopupStudent = true; }
- Jagadeesh Adaveni
- March 01, 2016
- Like
- 0
Unable to Delete Records using APEX????
Hi All,
I have written one Apex controller in that i wrote logic for delete and update. Problem here is am unable to delete records.
Thanks,
A.Jagadeesh
I have written one Apex controller in that i wrote logic for delete and update. Problem here is am unable to delete records.
public class logView3Controller { public Boolean searched { get; set; } public List<Weeks__c> weekList = Weeks__c.getAll().values(); public Map<Integer, Weeks__c> weekMap = new Map<Integer, Weeks__c>(); public Map<String, Integer> weekMapGetIntWithWeek = new Map<String, Integer>(); public Map<String, Subjects_and_Levels__c> subjectLevelMap = Subjects_and_Levels__c.getAll(); public List<Subjects_and_Levels__c> subjectLevelList = subjectLevelMap.values(); public Map<String, Subjects_and_Levels__c> levelMap = new Map<String, Subjects_and_Levels__c>(); public Date StartDate {get;set;} public Date EndDate {get;set;} public String selectedLocation {get;set;} public String selectedDay {get;set;} public List<Log_Book__c> logBookEntries {get;set;} public List<studentsWithWeeks> studentsWithWeeksList {get;set;} public studentsWithWeeks newSWW {get;set;} public String domain {get;set;} public List<integer> indexNums {get;set;} public List<String> weekTableHeader {get;set;} public List<String> subjectTableHeader {get;set;} public List<Log_Book__c> relatedLogs{get;set;} //Jagadeesh public String selectedTeacher{get;set;} public String selectedDays{get;set;} public Id recordToUpdateId {get;set;} public Id recordToUpdateIdStudent {get;set;} public log_Book__c logObj {get;set;} public Student__c studentObj {get;set;} public boolean displayPopup {get; set;} public boolean displayPopupStudent {get; set;} public String exportToExcelURL {get;set;} public log_Book__c newLevel{get;set;} public log_Book__c newWeek{get;set;} List<Log_Book__c> lbjump{get;set;} // 2. a,b,c,d - a,j,k,l,m - changing the complete series // Written by Jagadeesh(New code for skip records) public List<Log_Book__c> jump{get;set;} public Log_Book__c jump1{get;set;} public List<Log_Book__c> lblist{get;set;} List<Log_Book__c> updateLogs = new List<Log_Book__c>(); public logView3Controller () { domain = ApexPages.currentPage().getHeaders().get('Host'); //exportToExcelURL = '/apex/logView3ExportToExcel?startDate='+startDate+'&endDate='+endDate+'&selectedLocation='+selectedLocation; exportToExcelURL = '/apex/logView3ExportToExcel?startDate='+startDate+'&endDate='+endDate+'&selectedLocation='+selectedLocation+'&selectedTeacher='+selectedTeacher; weekTableHeader = new List<String>(); relatedLogs = new List<Log_book__c>(); searched = false; } public String getEnglishColor() { return Colr; } public PageReference doUpdateLogObj2() { String lv = logObj.Week__c.split('-')[0]; if(logObj.Subject__c == 'Math' && logObj.Level__c == 'Level 5B' && Integer.valueOf(lv) > 17){ logObj.Week__c.addError('For Math Level 5B week should not exceed 17'); return null; } system.debug('hii'); relatedLogs = [SELECT Id, Name, Color_Code__c, Comment_on_LogBook__c, Student__c, Student__r.Id, Student__r.Name, Student__r.Last_Name__c, Subject__c, Level__c, Week__c, Week_Day__c, Class_Scheduled_Date__c, Student__r.Location__r.Name FROM Log_Book__c WHERE Student__r.Id =: logObj.Student__r.Id AND Subject__c =: logObj.Subject__c AND Class_Scheduled_Date__c >=: logObj.Class_Scheduled_Date__c and isSkipped__c=false]; System.debug(' relatedLogs.Size()'+ relatedLogs.Size()); Log_Book__c lb = new Log_Book__c(); Integer levelOrder = Integer.valueof(subjectLevelMap.get(logObj.Subject__c +':'+logObj.Level__c).Order__c); Integer weekOrder; System.Debug('levelOrder :' + levelOrder); System.Debug('weekList :' + weekList); for(Weeks__c week : weekList) { weekMap.put((Integer)week.Order__c, week); weekMapGetIntWithWeek.put(week.Name, (Integer)week.Order__c); } System.Debug('weekMap :' + weekMap); System.Debug('weekMapGetIntWithWeek :'+ weekMapGetIntWithWeek); for(Subjects_and_Levels__c level: subjectLevelList) { levelMap.put(level.subject__c+Integer.valueof(level.Order__c), level); } System.Debug('levelMap :' + levelMap); Integer totalLevels = 0; if(logObj.Subject__c == 'English') totalLevels = 16; else if(logObj.Subject__c == 'Abacus') totalLevels = 11; else if(logObj.Subject__c == 'Math') totalLevels = 14; else if(logObj.Subject__c == 'G.K') totalLevels = 3; System.Debug('Total Logs :'+ relatedLogs.Size()); lb = logObj.clone(false, true, false, false); updateLogs.add(lb); for(Integer i=1; i<relatedLogs.Size(); i++) { lb = new Log_Book__c(); System.Debug('lblblblblblblb :' + lb); lb = updateLogs[i-1].clone(false, true, false, false); weekOrder = Integer.ValueOf(weekMapGetIntWithWeek.get(lb.Week__c)); System.Debug('weekOrder : ' + weekOrder); lb.Class_Scheduled_Date__c = lb.Class_Scheduled_Date__c.addDays(7); System.Debug('weekMapGetIntWithWeek.get(lb.Week__c) :'+ weekMapGetIntWithWeek.get(lb.Week__c)); System.Debug('weekMapGetIntWithWeek.get(lb.Week__c)+i :'+ Integer.ValueOf(weekMapGetIntWithWeek.get(lb.Week__c))+i); if( weekOrder < 26 ) { weekOrder = weekOrder+1; lb.Week__c = weekMap.get(weekOrder).Name; System.Debug('@@@@@@ lb.Week__c = ' + lb.Week__c); } else { if(lb.week__c == '26-Z') { if(levelOrder < totalLevels) { levelOrder = levelOrder +1; System.Debug('lb.Subject__c+levelOrder : '+ lb.Subject__c+levelOrder); lb.level__c = levelMap.get(lb.Subject__c+levelOrder).Level__c; lb.Week__c = '1-A'; } } else if(lb.Subject__c == 'Math' && lb.Level__c == 'Level 5B' && lb.Week__c == '17-Q') { if(levelOrder != null && levelOrder < totalLevels){ levelOrder = levelOrder +1; lb.level__c = levelMap.get(lb.Subject__c+levelOrder).Level__c; lb.Week__c = '1-A'; } } else { i = relatedLogs.Size(); } } System.Debug('lblblblblblblb :' + lb); updateLogs.add(lb); System.Debug('updateLogs : '+ updateLogs); } delete relatedLogs; update updateLogs; //insertLogs(); System.debug('@@@@@updated logs@@@'+updateLogs.size()+'----------->'+updateLogs[0]); displayPopup = false; return null; } }
Thanks,
A.Jagadeesh
- Jagadeesh Adaveni
- February 25, 2016
- Like
- 0
Getting error "Attempt to dereference null" in Batch apex.
Hi All,
I am getting error as Attempt to dereference null while am running batch apex. Could you please resolve it
Below is my code
Thanks,
Jagadeesh
I am getting error as Attempt to dereference null while am running batch apex. Could you please resolve it
Below is my code
global class batchLogBookManagementV2 implements Database.Batchable<sObject> { global List<Log_Book__c> logToBeContinued = new List<Log_Book__c> (); global List<Log_Book__c> logToBeInserted = new List<Log_Book__c> (); global List<Subject_Registered__c> sbsr = new List<Subject_Registered__c> (); global List<Weeks__c> weekList = Weeks__c.getAll().values(); global Map<Integer, Weeks__c> weekMap = new Map<Integer, Weeks__c>(); global Map<String, Integer> weekMapGetIntWithWeek = new Map<String, Integer>(); global Map<String, Subjects_and_Levels__c> subjectLevelMap = Subjects_and_Levels__c.getAll(); global List<Subjects_and_Levels__c> subjectLevelList = subjectLevelMap.values(); global Map<String, Subjects_and_Levels__c> levelMap = new Map<String, Subjects_and_Levels__c>(); global final String query = 'SELECT id, Last_Schedule__c, Level__c, Student__c, Subject__c, Week__c, (SELECT Student__c, Subjects_Registered__c, Subject__c, Class_Scheduled_Date__c, Level__c, Week__c FROM Log_Books__r ORDER By Class_Scheduled_Date__c DESC NULLS FIRST LIMIT 1 ) FROM Subject_Registered__c WHERE Deactivated__c = false AND Last_Schedule__c != null'; global Iterable<sObject> start(Database.BatchableContext BC){ sbsr = Database.query(query); for(Subject_Registered__c s: sbsr) { logToBeContinued.add(s.log_Books__r[0]); } return logToBeContinued; } global void execute(Database.BatchableContext BC,List<Log_Book__c> scope){ for(Subjects_and_Levels__c level: subjectLevelList) { system.debug('level : '+level); if(level !=null) levelMap.put(level.subject__c+Integer.valueof(level.Order__c), level); else system.debug('error as level null'); } for(Weeks__c week : weekList) { system.debug('week : '+week); if(week != null){ weekMap.put((Integer)week.Order__c, week); weekMapGetIntWithWeek.put(week.Name, (Integer)week.Order__c); } } System.debug('++++++++++++++++++++++++ : ' + scope); for(Log_Book__c s: scope) { System.debug('logToBeInserted-------------------------------- : ' + logToBeInserted.size()); System.debug('-------------------------------- : ' + s); Integer totalLevels = 0; if(s.Subject__c == 'English') totalLevels = 16; else if(s.Subject__c == 'Abacus') totalLevels = 11; else if(s.Subject__c == 'Math') totalLevels = 14; else if(s.Subject__c == 'G.K') totalLevels = 3; System.debug('xxxxxxxxxxxxxxxx : ' + subjectLevelMap); //System.debug('@@Subject@@@@@@@'+subjectLevelMap.get(s.Subject__c+s.level__c)); Integer levelOrder = Integer.valueof(subjectLevelMap.get(s.Subject__c +':'+s.Level__c).Order__c); system.debug('level order: '+levelOrder); Integer weekOrder = Integer.ValueOf(weekMapGetIntWithWeek.get(s.Week__c)); system.debug('week order: '+weekOrder); Log_Book__c l = new Log_Book__c (); l.Student__c = s.Student__c; l.Subject__c = s.Subject__c; l.Subjects_Registered__c = s.Subjects_Registered__c; l.Class_Scheduled_Date__c = s.Class_Scheduled_Date__c.addDays(7); if(s.Week__c == '26-Z') { if(levelOrder < totalLevels) { levelOrder = levelOrder +1; System.Debug('lb.Subject__c+levelOrder : '+ l.Subject__c+levelOrder); l.level__c = levelMap.get(l.Subject__c+levelOrder).Level__c; l.Week__c = '1-A'; logToBeInserted.add(l); } } else if(s.Subject__c == 'Math' && s.Level__c == 'Level 5B' && s.Week__c == '17-Q') { if(levelOrder < totalLevels) { levelOrder = levelOrder +1; System.Debug('lb.Subject__c+levelOrder : '+ l.Subject__c+levelOrder); l.level__c = levelMap.get(l.Subject__c+levelOrder).Level__c; l.Week__c = '1-A'; logToBeInserted.add(l); } } else { weekOrder = weekOrder+1; l.Week__c = weekMap.get(weekOrder).Name; l.Level__c = s.Level__c; logToBeInserted.add(l); } } if(logToBeInserted.size()>0) { Database.SaveResult[] srList = Database.insert(logToBeInserted, false); // Iterate through each returned result for (Database.SaveResult sr : srList) { if (sr.isSuccess()) { // Operation was successful, so get the ID of the record that was processed System.debug('Successfully inserted LogBook. LogBook ID: ' + sr.getId()); } else { // Operation failed, so get all errors for(Database.Error err : sr.getErrors()) { System.debug('The following error has occurred.'); System.debug(err.getStatusCode() + ': ' + err.getMessage()); System.debug('Account fields that affected this error: ' + err.getFields()); } } } } // System.debug('############################### :' + ((Subject_Registered__c)scope.get(0)).log_Book__r.Class_Scheduled_Date__c); // scope variable now has the records received from QueryLocator. // delete scope; // Database.emptyRecycleBin(scope); } global void finish(Database.BatchableContext BC){ AsyncApexJob a = [SELECT Id, Status, NumberOfErrors, JobItemsProcessed, TotalJobItems, CreatedBy.Email FROM AsyncApexJob WHERE Id =:BC.getJobId()]; // Send an email to the Apex job's submitter // notifying of job completion. Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); String[] toAddresses = new String[] {a.CreatedBy.Email}; mail.setToAddresses(toAddresses); mail.setSubject('BAtch: ' + a.Status); mail.setPlainTextBody('The batch Apex job processed ' + a.TotalJobItems +' batches with '+ a.NumberOfErrors + ' failures.'); Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); } }Below are my custom settings
Thanks,
Jagadeesh
- Jagadeesh Adaveni
- February 22, 2016
- Like
- 0