Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // updating the bulk records in custom object
- list<Student__c> stnewlist=new list<Student__c>();
- list<Student__c> stlist=[select id, name,COURSE_FEE__c,library__c from student__c where Country__c='India'];
- for(Student__c st:stlist)
- {
- system.debug('student record is'+st);
- st.COURSE_FEE__c= st.COURSE_FEE__c - st.COURSE_FEE__c+0.1;
- st.E_mail_id__c='bulkrecords@bulk.com';
- st.States__c='Andhra Pradesh';
- st.library__c='a029000000JwWDt';
- st.City__c='Vijayawada';
- stnewlist.add(st);
- }
- update stnewlist;
- st.COURSE_FEE__c= st.COURSE_FEE__c - st.COURSE_FEE__c+0.1;
- if (st.COURSE_FEE__c != null) {
- st.COURSE_FEE__c= st.COURSE_FEE__c - st.COURSE_FEE__c+0.1;
- } else {
- // Handle null case
- }
- List<student__c> stlist = new List<student__c>();
- stlist = [select id, name,COURSE_FEE__c,library__c from student__c where Country__c='India']
- List<student__c> stnewlist = new List<student__c>();
- //Check if List is not empty before proceeding to the business logic
- if(!stList.IsEmpty()) {
- }
- // updating the bulk records in custom object
- List<Student__c> stnewlist=new List<Student__c>();
- list<Student__c> stlist= new list<Student__c>();
- stlist = [select id, name, COURSE_FEE__c, library__c from student__c where Country__c='India'];
- for(Student__c st : stlist)
- {
- system.debug('student record is'+st);
- if( st.COURSE_FEE__c!= null)
- st.COURSE_FEE__c= st.COURSE_FEE__c - st.COURSE_FEE__c+0.1;
- st.E_mail_id__c='bulkrecords@bulk.com';
- st.States__c='Andhra Pradesh';
- st.library__c='a029000000JwWDt';
- st.City__c='Vijayawada';
- stnewlist.add(st);
- }
- update stnewlis;
- / updating the bulk records in custom object
- List< student__c > stlist=[select id, name,COURSE_FEE__c,library__c from student__c where Country__c='India'];
- for(Student__c st:stlist)
- {
- system.debug('student record is'+st);
- st.COURSE_FEE__c= st.COURSE_FEE__c - st.COURSE_FEE__c+0.1;
- st.E_mail_id__c='bulkrecords@bulk.com';
- st.States__c='Andhra Pradesh';
- st.library__c='a029000000JwWDt';
- st.City__c='Vijayawada';
- // stnewlist.add(st); // not required //
- }
- //update stnewlist; // not required, use existing list which is already changed and just update it.
- update stlist;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement