Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8125129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:42:36+00:00 2026-06-06T06:42:36+00:00

I am developing an application in which i am retrieving records from an object

  • 0

I am developing an application in which i am retrieving records from an object and then want to insert (some of the fields of the) records into different objects. Below is my code in which i cannot figure it out that why my objects are not being populated and new record cannot be seen .

// Scheduler related class 1

public with sharing class ScheduleBatchLauncher{
public static String scheduleBatch(Datetime batchTime){
    CreateAndModifyScheduler batchSched = new CreateAndModifyScheduler();
    String cron = '20 25 * * * ?';
    String schedId = System.schedule('Create and Modify Batch 1', cron, batchSched);       
    return schedId;
}
}

// Scheduler related class 2

global class CreateAndModifyScheduler implements Schedulable{
global void execute(SchedulableContext sc) {
  CreateAndModify scBatch = new CreateAndModify(); 
  database.executebatch(scBatch);
}
}

// Batch Apex related class 1

global class CreateAndModify implements
Database.Batchable<sObject>, Database.Stateful{

global CreateAndModifyProcessor processor;
global CreateAndModify(){
        this.processor = new CreateAndModifyProcessor();
    }

global Database.queryLocator start
    (Database.BatchableContext BC){
        return Database.getQueryLocator([Select Agreement_ID__c, Begining__c,
                                        Contact_Email__c, Contact_Name__c,
                                        Country_Code__c, Currency__c,
                                        Customer_Address__c, Customer_ID__c,
                                        Customer_Name__c,Customer_Postal_Code__c,
                                        Ending__c,Price__c FROM Unprocessed_Agreement__c]);
        }

global void execute(
    Database.BatchableContext BC, 
    List<sObject> listObj){

        list <Account__c> inAcc = new list<Account__c>();

        for (sObject lo : listObj){
            Unprocessed_Agreement__c temp = (Unprocessed_Agreement__c)lo;

            inAcc.add(processor.processAccountRecord(temp));    
            }
        insert(inAcc);
        update(inAcc)
      }

global void finish(
    Database.BatchableContext BC){
    }
}

// Batch Apex related class 2

global class CreateAndModifyProcessor {
global Account__c processAccountRecord( Unprocessed_Agreement__c temp){
    Account__c tempAcc = new Account__c();
    tempAcc.Customer_Name__c = temp.Customer_Name__c;
    tempAcc.Customer_Address__c = temp.Customer_Address__c;
    tempAcc.Postal_Code__c = temp.Customer_Postal_Code__c;
    return tempAcc;
}   
}

Please if someone can have a look at it. Also, if someone wants to see my build.xml or package.xml please tell..Thank You

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:42:37+00:00Added an answer on June 6, 2026 at 6:42 am

    you’re running a scheduled batch job so every execution is monitored by the system. check setup – administration setup – monitoring – apex jobs for errors.
    another debugging option would be using execute anonymous (in eclipse or ui) to execute your job manually and check the logs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing iPad application which involve retrieving information from webservice and then
I am developing an application which starts from LoginPage. When user Login then he
I'm developing an application which queries data from the host, and then inserts them
I`m developing an application which receives data from my GPS device like coordinates, speed
I am developing an application which depends on libpcap and want to know how
Am developing android application which contains floating menu effect from left to right. I
We are developing an application which accesses an API exposed over some embedded system.
I am developing an application which has defined some intent filters (in the form
I am developing an application which generates barcodes, I want to print them but
I'm developing an application which currently have hundreds of objects created. Is it possible

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.