• krishnag
  • SMARTIE
  • 574 Points
  • Member since 2010

  • Chatter
    Feed
  • 23
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 79
    Questions
  • 259
    Replies

I don't know what happened, but I had several triggers working previously, and now I can't even deploy previous triggers that used to be working in production.  The first trigger and class is below.. I think there is something wrong with my test class that is not making the trigger fire (test coverage is 100% in sandbox). Perhaps this causing the code coverage upon deployment to be 0%.... PLEASE HELP.

 

THIS IS MY TRIGGER THAT WORKS IN SANDBOX

 

trigger statusChangeAutoEmail on Lead (after update) {
List<Messaging.SingleEmailMessage> messages = new List<Messaging.SingleEmailMessage>();
List<Lead> leadsToUpdate=new List<Lead>();

List<Lead> leadList= [select Id, Email,X1st_Attempt_Email__c,X2nd_Attempt_Email__c, 
    Closed_Lost_Email__c, Status,Franchise_Concept__c, Owner.Name,Owner.Email from Lead 
    where International__c=false AND No_Auto_Email__c=false AND EmailBouncedReason=NULL AND
    (Status!='New Lead' or Status!='Qualified')]; 

for(Lead leadEmail : leadList) {
       
        if(leadEmail.Status == '1st Attempt' && leadEmail.X1st_Attempt_Email__c==false
        ) {       
            //send Email
            String template = ''; // initialize variable to hold template name filled in below           
            template = 'Standard Auto Sales Appt Reminder Email';
           
            Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
            message.setTemplateId([select id from EmailTemplate where Name = :template].id);
            message.setTargetObjectId(leadEmail.id);
           
            // String to hold the email addresses to which the email is being sent. 
            message.setToAddresses (new String[] {leadEmail.Email});
            
            message.setsaveAsActivity(true);
            message.setsenderDisplayName(leadEmail.Owner.Name);
            message.setreplyTo(leadEmail.Owner.Email);

            // Add the e-mail to the list to be sent
            messages.add(message);
            
            //update to Lead so email only sent once
            leadEmail.X1st_Attempt_Email__c=true;
            leadsToUpdate.add(leadEmail);
            
        }            
                    
        
        else if(leadEmail.Status == '2nd Attempt' && leadEmail.X2nd_Attempt_Email__c==false
        ) {       
            //send Email
            String template = ''; // initialize variable to hold template name filled in below           
            template = 'Standard Auto Sales Appt Reminder Email';
           
            Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
            message.setTemplateId([select id from EmailTemplate where Name = :template].id);
            message.setTargetObjectId(leadEmail.id);
           
            // String to hold the email addresses to which the email is being sent. 
            message.setToAddresses (new String[] {leadEmail.Email});
            
            message.setsaveAsActivity(true);
            message.setsenderDisplayName(leadEmail.Owner.Name);
            message.setreplyTo(leadEmail.Owner.Email);

            // Add the e-mail to the list to be sent
            messages.add(message);
            
            //update to Lead so email only sent once
            leadEmail.X2nd_Attempt_Email__c=true;
            leadsToUpdate.add(leadEmail);
                      
        }

        else if(leadEmail.Status == 'Closed - Lost' && leadEmail.Closed_Lost_Email__c==false
        ) {       
            //send Email
            String template = ''; // initialize variable to hold template name filled in below           
            template = 'Standard Auto Sales Appt Reminder Email';
           
            Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
            message.setTemplateId([select id from EmailTemplate where Name = :template].id);
            message.setTargetObjectId(leadEmail.id);
           
            // String to hold the email addresses to which the email is being sent. 
            message.setToAddresses (new String[] {leadEmail.Email});
            
            message.setsaveAsActivity(true);
            message.setsenderDisplayName(leadEmail.Owner.Name);
            message.setreplyTo(leadEmail.Owner.Email);

            // Add the e-mail to the list to be sent
            messages.add(message);
            
            //update to Lead so email only sent once
            leadEmail.Closed_Lost_Email__c=true;
            leadsToUpdate.add(leadEmail);
                        
        }                     
        
        else{
        }
    }  //end for statement      
        Messaging.sendEmail(messages);
        update leadsToUpdate;    
} //end trigger

 

THIS IS MY TEST CLASS

 

@isTest
private class statusChangeAutoEmail {

    static testMethod void statusChangeAutoEmail() {

    List<Messaging.SingleEmailMessage> messages = new List<Messaging.SingleEmailMessage>();
    List<Lead> leadsToUpdate=new List<Lead>();
    
    
    Lead[] leadsToCreate=new Lead[]{};
    for(Integer x=0; x<20; x++){
        Lead ld = new Lead(lastname='test', Status='1st Attempt', email='test@testing.com',company='test');
        leadsToCreate.add(ld);
    }    

    for(Integer x=0; x<20; x++){
        Lead ld = new Lead(lastname='test', Status='2nd Attempt', email='test@testing.com',company='test');
        leadsToCreate.add(ld);
    }

    for(Integer x=0; x<20; x++){
        Lead ld = new Lead(lastname='test', Status='Closed - Lost', email='test@testing.com',company='test',
        Closed_Lost_Dispositions__c='Other');
        leadsToCreate.add(ld);
    }    
        

    //Now for the test...
    Test.startTest();
    insert leadsToCreate;
    Messaging.sendEmail(messages);
    Test.stopTest();
        
        
        
    }
}

 

I'm pretty frantic at this point, since our sales team relies on several of these triggers that used to work... Help would be MOST APPRECIATED

 

-Amanda

Hi all:

   I am using the wizard apec controller from the book, and decided to write a test class I am getting errors all over ...

please help..

 

System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Name]: [Name]

 

Class.newOpportunityController.save: line 88, column 7 Class.newOpportunityController.hol: line 146, column 8 External entry point

 

 

public class newOpportunityController {

// These four member variables maintain the state of the wizard.

// When users enter data into the wizard, their input is stored

// in these variables.

Account account;
Contact contact;
Opportunity opportunity;
OpportunityContactRole role;


// The next four methods return one of each of the four member

// variables. If this is the first time the method is called,

// it creates an empty record for the variable.

public Account getAccount() {
if(account == null) account = new Account();
return account;
}

public Contact getContact() {
if(contact == null) contact = new Contact();
return contact;
}

public Opportunity getOpportunity() {
if(opportunity == null) opportunity = new Opportunity();
return opportunity;
}

public OpportunityContactRole getRole() {
if(role == null) role = new OpportunityContactRole();
return role;
}


// The next three methods control navigation through

// the wizard. Each returns a PageReference for one of the three pages

// in the wizard. Note that the redirect attribute does not need to

// be set on the PageReference because the URL does not need to change

// when users move from page to page.

public PageReference step1() {
return Page.opptyStep1;
}

public PageReference step2() {
return Page.opptyStep2;
}

public PageReference step3() {
return Page.opptyStep3;
}


// This method cancels the wizard, and returns the user to the

// Opportunities tab

public PageReference cancel() {
PageReference opportunityPage = new ApexPages.StandardController(opportunity).view();
opportunityPage.setRedirect(true);
return opportunityPage;
}

// This method performs the final save for all four objects, and

// then navigates the user to the detail page for the new

// opportunity.

public PageReference save() {

// Create the account. Before inserting, copy the contact's

// phone number into the account phone number field.

account.phone = contact.phone;
insert account;

// Create the contact. Before inserting, use the id field

// that's created once the account is inserted to create

// the relationship between the contact and the account.

contact.accountId = account.id;
insert contact;

// Create the opportunity. Before inserting, create

// another relationship with the account.

opportunity.accountId = account.id;
insert opportunity;

// Create the junction contact role between the opportunity

// and the contact.

role.opportunityId = opportunity.id;
role.contactId = contact.id;
insert role;

// Finally, send the user to the detail page for

// the new opportunity.



PageReference opptyPage = new ApexPages.StandardController(opportunity).view();
opptyPage.setRedirect(true);

return opptyPage;
}
static testmethod void hol(){
newOpportunityController ext = new newOpportunityController();
Account acct = new Account();
acct.Name = 'sjsjs';
insert acct;
ext.getAccount();

Contact con = new Contact();
con.firstname='jdhjd';
con.lastname='hdjdhdh';
con.email='hello@email.com';
insert con;
ext.getContact();

Opportunity opp = new Opportunity();
opp.Name = 'lslsls';
opp.Accountid=acct.id;
opp.stageName='Lead';
opp.CloseDate=Date.newinstance(2010,12,31);
insert opp;
ext.getOpportunity();
ext.save();
}

}

 

Greetings.

 

I have an issue in rendering a visual force page between html and pdf format. HTML rendering is bringing the text area, select box, check box etc but when I do the same in pdf I am not seeing any of those html components. Is there any way to render the same between PDF and HTML?

 

 

Thanks a bunch.

System.EmailException: SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Missing body, need at least one of html or plainText:

Hi!

 

I'm new to VisualForce development and i have a question. Now I understand how to use VisualForce pages to present the Force Site data to end-users. But, is there a way to make a VisualForce page through which the end users can input data back into the SalesForce application (database). Basically, I want to provide the funcionality to insert new data through a VisualForce page.

 

Thank you!

Hi,

I've created a vf page with a lead form that correctly inserts a lead using a custom controller. However, when I send the link to someone (or open in a different browser where I'm not logged in) the page requires login to access. The user type associated with the site is Guest User. I've set all the permissions that I think the page needs. How can I allow access to this page without login? Even a guest user still needs a login! Please help!!!

hi friends,

 

I have gone through the site for Devry university.Its pretty impressive i there anybody in the group who are in the team of this site development.I want to ask some tips and tricks to get such a look and feel.

hi,

I have a requirement here where i need to access the salesforce reports data and put them in field of visualforce page.

 

Like i am generating a metrics data table where it displays number of accounts created this year,number of contacts created this year and so on. The thing here is i can use the queries but the problem comes up with governor limits query row limitation 10000 records. controller is limited to fetch only 10000 records in the whole context.

 

So i want to get the already fetched data in the reports and just display them in the table as fields.

 

Any ideas on this Its real urgent please help me.

hi,

 

I want to get some help in writing an SOQL query where the scenario is

 

i want the count of number of contacts where the account its related to have some field abc = true..

 

 

hi when i tried to deploy my class its throwing an error  saying too many query rows 10001.What is that mean.

hi,

i need small clarification for the governor limit too many query row limit for a context. I know apex has a governor limit like number of query rows fetched in a context should not be more than 10000. I want to know the limitation is for a query or a sum of all the records for a class.

hi,

 

I have a controller which reads the values of an object and display it in the outputpanel according to some criteria we give.

The problem here is when we write a test class i know we need to insert test data for objects we use.My object which i am using here is readonly object we cannot insert data into it manually they have siome formula fields in it.

So when i try to create a new test data for this object it throws an exception saying insertion failed since the object is readonly dont have enough permissions. So how can i write this test class.

hi,

 

I am using Google Visualization API for custom Report building on Visualforce pages.IN order to display the data in a graph where i am calculating the yearly data like number of accounts created in this year.

 

I used select count() from Accounts where Lead_Created_Date__c = This_Year; query which fetches the details the count of number of accounts created in this year.

 

I am hitting a governor limit since i have more than 10,000 accounts created this year. I heard that API has no governor limits then why I am getting this limit.I am using this query in controller of the visualforce page.I know the controller is an apex component so i Am getting this limitations.

 

Do u have any alternative suggestions to go ahead with it.

hi,

I have an requirement here.I need to design a visualforce page like a table.The data in the table should dispLAY THE analytic data.Like number of accounts created this year.And kind of number of contacts,It just display the count of the data.

I tried to use the count function in the controller.But its hitting the governor limits number of records fetched is greater than 10,000 records.

 

So I am looking for alternative like can we fetch the data from reports.I know reports is not an Object in salesforce, It doesnt have fields to access.But i am looking for any alternative to fetch the data from existing reports.

Apex script unhandled exception by user/organization: 005800000036bA4/00D80000000cSrC

Failed to invoke future method 'public static void updateRelationMethod(LIST<String>)' on class 'updateRelation' for job id '70780000003Dr5C'

caused by: System.DmlException: Update failed. First exception on row 0 with id 0018000000eg4YmAAI; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []

Class.updateRelation.updateRelationMethod: line 162, column 1
External entry point

hi is it possible to create a field on a custom object which gives the count of Accounts.Like this object should display all the numerical data.

 

field ---> Num Accounts  ---> should give the count of all accounts in the org.

 

I know reports help us to get this info But i need to get this for some other purpose.

hi i have a Asynchronous class with future method when i load data using dataloader.I am geting an exception saying

 

Apex script unhandled exception by user/organization: 005800000036bA4/00D80000000cSrC

Failed to invoke future method 'public static void updateRelationMethod(LIST<String>)' on class 'updateRelation' for job id '70780000003Dn62'

caused by: System.LimitException: Too many SOQL queries: 101

Class.updateRelation.updateRelationMethod: line 66, column 38
External entry point
public class updateRelation {

@future
public static void updateRelationMethod(list<String> AccountIds){

List<Account> acc = [select id,Company_Relationship__c,Direct_Markets_Customer__c,Z_Programs_Customer__c  from Account where Company_Relationship__c != 'Broker' and Company_Relationship__c !='Employee' and Id IN :AccountIds];

 for(Account temp :acc)
{
    System.debug('In if loop');


    list<Policy__c> NonActivePolicy1 = [select Id,Policy_Status__c from Policy__c where 
                                                     Company_Name__c =:temp.Id limit 1];
  // start of condition 2
  if(!NonActivePolicy1.isEmpty()){
      temp.Company_Relationship__c = 'Customer';
  list<Policy__c> ActivePolicy = [select Id,Policy_Status__c from Policy__c where Policy_Status__c ='Active'
                                                     and Company_Name__c =:temp.Id limit 1];
     //Start of condition 3
    if(!ActivePolicy.isEmpty()){
          temp.Relationship_Type__c = 'Current'; 
  
  }
  //END of if 3  
  
  //Start of condition4 1
  else{
        Date tempd = System.today()+180;
      list<Policy__c> NonActivePolicy = [select Id,Policy_Status__c,Policy_Expiration_Date__c from Policy__c where 
                                                Company_Name__c =:temp.Id 
                                                          and Policy_Expiration_Date__c >:tempd limit 1];
     if(!NonActivePolicy.isEmpty()){
        temp.Relationship_Type__c = 'Current';
        }
        else{
          list<Submission__c> subBondType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                                Account_Name__c =:temp.Id and Submission_Status__c ='Bound' limit 1]; 
            //start of condition7 5
            if(!subBondType.isEmpty()){
                 temp.Company_Relationship__c = 'Customer';
                 if(subBondType[0].Policy_Status__c == 'Active')
                 {
                     temp.Relationship_Type__c = 'Current';
                     }
                 else
                 {
                     temp.Relationship_Type__c = 'Former';   
               }}
               else{
               temp.Relationship_Type__c ='Former';
               }
            //end of if 5
         // Start of condition8 3
        
          
        
        
  }    }
//End of else 1
}
//end of if 2

//Start of condition5 2
else{
      list<Submission__c> subType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                               Account_Name__c =:temp.Id  limit 1]; 
 //start of condition6 4
 if(!subType.isEmpty()){
      list<Submission__c> subBondType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                                Account_Name__c =:temp.Id and Submission_Status__c ='Bound' limit 1]; 
            //start of condition7 5
            if(!subBondType.isEmpty()){
                 temp.Company_Relationship__c = 'Customer';
                 if(subBondType[0].Policy_Status__c == 'Active')
                     temp.Relationship_Type__c = 'Current';
                 else
                     temp.Relationship_Type__c = 'Former';   
               }
            //end of if 5
         // Start of condition8 3
         else {
            temp.Company_Relationship__c = 'Prospect';
            temp.Relationship_Type__c = 'Activity';
         } 
         //END of else 3    
 }
 //end of if 4
// START of condition9 4
else {
    System.debug('In last if loop');
      if(temp.Direct_Markets_Customer__c==True || temp.Z_Programs_Customer__c ==True)
      {
      temp.Company_Relationship__c = 'Programs';
      }
      else{
            temp.Company_Relationship__c = 'Prospect';
            temp.Relationship_Type__c = 'No Activity';    
          }
  }
// End of else 4
}
//END of else 2
  }
  //END of if 1
  ProcessorControl.inFutureContext = true;
update acc;
    }
}

 

hi i have an asynchronous class for a trigger.I got an exception last night saying

 

 

Limit exceeded 200 method calls for a day. What is this how can we avoid this.

how to make a trigger inactive in production

hi ,

I have a trigger which was working fine till now and when we load data using data loader the trigger is not firing and throwing an exception too many SOQL queries 21.

 

DO i need to write a trigger ti handle large data speerately or is there anyway please suggest me i am pasting my trigger code.

 

 

trigger UpdateRelationShipOnAccount on Account (before update) {

//start of condition 1
if(Trigger.new[0].Company_Relationship__c!='Broker' && Trigger.new[0].Company_Relationship__c!='Employee'){
    System.debug('In if loop');


    list<Policy__c> NonActivePolicy1 = [select Id,Policy_Status__c from Policy__c where 
                                                     Company_Name__c =:Trigger.new[0].Id limit 1];
  // start of condition 2
  if(!NonActivePolicy1.isEmpty()){
      Trigger.new[0].Company_Relationship__c = 'Customer';
  list<Policy__c> ActivePolicy = [select Id,Policy_Status__c from Policy__c where Policy_Status__c ='Active'
                                                     and Company_Name__c =:Trigger.new[0].Id limit 1];
     //Start of condition 3
    if(!ActivePolicy.isEmpty()){
          Trigger.new[0].Relationship_Type__c = 'Current'; 
  
  }
  //END of if 3  
  
  //Start of condition4 1
  else{
        Date temp = System.today()+180;
      list<Policy__c> NonActivePolicy = [select Id,Policy_Status__c,Policy_Expiration_Date__c from Policy__c where 
                                                Company_Name__c =:Trigger.new[0].Id 
                                                          and Policy_Expiration_Date__c >:temp limit 1];
     if(!NonActivePolicy.isEmpty()){
        Trigger.new[0].Relationship_Type__c = 'Current';
        }
        else{
          list<Submission__c> subBondType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                                Account_Name__c =:Trigger.new[0].Id and Submission_Status__c ='Bound' limit 1]; 
            //start of condition7 5
            if(!subBondType.isEmpty()){
                 Trigger.new[0].Company_Relationship__c = 'Customer';
                 if(subBondType[0].Policy_Status__c == 'Active')
                 {
                     Trigger.new[0].Relationship_Type__c = 'Current';
                     }
                 else
                 {
                     Trigger.new[0].Relationship_Type__c = 'Former';   
               }}
               else{
               Trigger.new[0].Relationship_Type__c ='Former';
               }
            //end of if 5
         // Start of condition8 3
        
          
        
        
  }    }
//End of else 1
}
//end of if 2

//Start of condition5 2
else{
      list<Submission__c> subType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                               Account_Name__c =:Trigger.new[0].Id  limit 1]; 
 //start of condition6 4
 if(!subType.isEmpty()){
      list<Submission__c> subBondType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                                Account_Name__c =:Trigger.new[0].Id and Submission_Status__c ='Bound' limit 1]; 
            //start of condition7 5
            if(!subBondType.isEmpty()){
                 Trigger.new[0].Company_Relationship__c = 'Customer';
                 if(subBondType[0].Policy_Status__c == 'Active')
                     Trigger.new[0].Relationship_Type__c = 'Current';
                 else
                     Trigger.new[0].Relationship_Type__c = 'Former';   
               }
            //end of if 5
         // Start of condition8 3
         else {
            Trigger.new[0].Company_Relationship__c = 'Prospect';
            Trigger.new[0].Relationship_Type__c = 'Activity';
         } 
         //END of else 3    
 }
 //end of if 4
// START of condition9 4
else {
    System.debug('In last if loop');
      if(Trigger.new[0].Direct_Markets_Customer__c==True || Trigger.new[0].Z_Programs_Customer__c ==True)
      {
      Trigger.new[0].Company_Relationship__c = 'Programs';
      }
      else{
            Trigger.new[0].Company_Relationship__c = 'Prospect';
            Trigger.new[0].Relationship_Type__c = 'No Activity';    
          }
  }
// End of else 4
}
//END of else 2
  }
  //END of if 1
}

 

 

hi ,

 

i wrote a trigger and it was working fine and i made small change in the logic and it throwing an exception saying too many SOQL queries 21.

 

BUt my trigger has only 6 SOQL queries.I am posting my code please anybody can find the error.

 

 

 

trigger UpdateRelationShipOnAccount on Account (before update) {

//start of condition 1
if(Trigger.new[0].Company_Relationship__c!='Broker' && Trigger.new[0].Company_Relationship__c!='Employee'){
    System.debug('In if loop');


    list<Policy__c> NonActivePolicy1 = [select Id,Policy_Status__c from Policy__c where 
                                                     Company_Name__c =:Trigger.new[0].Id limit 1];
  // start of condition 2
  if(!NonActivePolicy1.isEmpty()){
      Trigger.new[0].Company_Relationship__c = 'Customer';
  list<Policy__c> ActivePolicy = [select Id,Policy_Status__c from Policy__c where Policy_Status__c ='Active'
                                                     and Company_Name__c =:Trigger.new[0].Id limit 1];
     //Start of condition 3
    if(!ActivePolicy.isEmpty()){
          Trigger.new[0].Relationship_Type__c = 'Current'; 
  
  }
  //END of if 3  
  
  //Start of condition4 1
  else{
        Date temp = System.today()+180;
      list<Policy__c> NonActivePolicy = [select Id,Policy_Status__c,Policy_Expiration_Date__c from Policy__c where 
                                                Company_Name__c =:Trigger.new[0].Id 
                                                          and Policy_Expiration_Date__c >:temp limit 1];
     if(!NonActivePolicy.isEmpty()){
        Trigger.new[0].Relationship_Type__c = 'Current';
        }
        else{
          list<Submission__c> subBondType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                                Account_Name__c =:Trigger.new[0].Id and Submission_Status__c ='Bound' limit 1]; 
            //start of condition7 5
            if(!subBondType.isEmpty()){
                 Trigger.new[0].Company_Relationship__c = 'Customer';
                 if(subBondType[0].Policy_Status__c == 'Active')
                 {
                     Trigger.new[0].Relationship_Type__c = 'Current';
                     }
                 else
                 {
                     Trigger.new[0].Relationship_Type__c = 'Former';   
               }}
               else{
               Trigger.new[0].Relationship_Type__c ='Former';
               }
            //end of if 5
         // Start of condition8 3
        
          
        
        
  }    }
//End of else 1
}
//end of if 2

//Start of condition5 2
else{
      list<Submission__c> subType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                               Account_Name__c =:Trigger.new[0].Id  limit 1]; 
 //start of condition6 4
 if(!subType.isEmpty()){
      list<Submission__c> subBondType =  [SELECT Id,Submission_Status__c,Policy_Status__c FROM Submission__c where 
                                                Account_Name__c =:Trigger.new[0].Id and Submission_Status__c ='Bound' limit 1]; 
            //start of condition7 5
            if(!subBondType.isEmpty()){
                 Trigger.new[0].Company_Relationship__c = 'Customer';
                 if(subBondType[0].Policy_Status__c == 'Active')
                     Trigger.new[0].Relationship_Type__c = 'Current';
                 else
                     Trigger.new[0].Relationship_Type__c = 'Former';   
               }
            //end of if 5
         // Start of condition8 3
         else {
            Trigger.new[0].Company_Relationship__c = 'Prospect';
            Trigger.new[0].Relationship_Type__c = 'Activity';
         } 
         //END of else 3    
 }
 //end of if 4
// START of condition9 4
else {
    System.debug('In last if loop');
      if(Trigger.new[0].Direct_Markets_Customer__c==True || Trigger.new[0].Z_Programs_Customer__c ==True)
      {
      Trigger.new[0].Company_Relationship__c = 'Programs';
      }
      else{
            Trigger.new[0].Company_Relationship__c = 'Prospect';
            Trigger.new[0].Relationship_Type__c = 'No Activity';    
          }
  }
// End of else 4
}
//END of else 2
  }
  //END of if 1
}

 

its throwing the error at the highlighted part of the trigger.

 

hi,

 

I have query like select count() some condition and it returns more than 10000 records.

 

As per the governor limits we cannot fetch more than 10000 records using query .What is the alternative to get rid of this limit.

can anybody explain me what is this error.I am trying to deploy a contoller class and visualforce page into production and i am geting this error.

 

system.limit.exception:    Too many query rows 501.

can anybody explain me what is this error.I am trying to deploy a contoller class and visualforce page into production and i am geting this error.

 

system.limit.exception:    Too many query rows 501.

hi ,

I want to create a random password and send to the users for their login in to my site.I have their salesforce email Ids.So i need to generate a random password.Can anybody share code if you can.

hi i wrote a query with multiple conditions in it i dont know what s the wrong in it.I ma posting the query in here 

 

 

integer numE = [select count() from Account where  Company_Relationship__c = 'Employee' and Lead_Created_Date__c>=:FromDate AND Lead_Created_Date__c<=:ToDate];

 

 

the above query worked fine until and i added ine more and condition

 

integer numE = [select count() from Account where HelpPoint_Delivered__c = "true" and Company_Relationship__c = 'Employee' and Lead_Created_Date__c>=:FromDate AND Lead_Created_Date__c<=:ToDate];

 

this query is making wrong data .Is there anything limitation like we cannot add these and conditions in a query

 

 

i am wondering if the holiday object can be used to check is the current date is not that of a holiday and how would one go about it?

Does anyone have existing code of dynamically building a dropdown in controller so that on the visualforce page would look like this (it always starts from current month and current year) for the next 24 months:

 

Aug-2010

Sep-2010

Oct -2010

Nov-2010

Dec-2010

Jan-2011

Feb-2011

Mar-2011

...

...

 

with value:

8-2010

9-2010

10-2010

11-2010

12-2010

1-2011

2-2011

3-2011

...

...

 

 

Any help will be greatly appreciated.

I have a trigger that runs on lead update (when a lead is converted to a contact.) . We use demand tools to dedupe leads to leads and then leads to contacts. When we run demand tools its giving me this error

 

UpdateContactOnLeadUpdate: execution of AfterUpdate

 

caused by: System.Exception: Too many SOQL queries: 101

 

Trigger.UpdateContactOnLeadUpdate: line 13, column 25

 

I am pasting the code for my trigger below. Line 13 is where I am getting the recordTypes . Its a single query. I am not sure why its causing this error. 

 

 

trigger UpdateContactOnLeadUpdate on Lead (after Update)
{
  List<String> conIds = new List<String>();
  List<String> leadIds = new List<String>();
  
  Map<String,Lead> leadMap = new map<String,Lead>();
  Map<String,Contact> contactMap = new map<String,Contact>();
  List<Key_Event__c> keyEventsToInsert = new List<Key_Event__c>();
  List<Lead_Key_Event__c> keyEventsToDelete = new List<Lead_Key_Event__c>();
  
  List<Contact> consToUpdate = new List<Contact>();
  
  RecordType[] recType = [Select Id, Name, SobjectType from RecordType 
                                            Where SOBjectType =: 'Key_Event__c'];line13
  
    For(Lead lead : Trigger.new)
    {
        //the lead is just converted
        if(lead.IsConverted == true && Trigger.oldMap.get(lead.Id).IsConverted == false)
        {
          leadIds.add(lead.Id);
          
          leadMap.put(lead.Id,lead);
          
          conIds.Add(lead.ConvertedContactId);
        }
    }
    
    //get the key events for the leads
    List<Lead_Key_Event__c> leadKeyEvents = [Select k.Auto_Demo_Field_1__c,k.Appt_Scheduled_Date__c, k.Auto_demo_Field_2__c,k.Lead_Confirmed_by_RM_NAM__c, 
                      k.Best_time_to_contact_prospects__c,k.Contact_Sales_Comments__c, 
                      k.CreatedById, k.CreatedDate, k.Id, k.IsDeleted, k.Key_Event_Type__c, 
                      k.LastModifiedById, k.LastModifiedDate, k.Lead__c, k.Lead_Created_Date__c, k.Name, 
                      k.Primary_Business_Pain__c, k.Purchase_decision_timeframe__c, 
                      k.Score__c, k.SystemModstamp, k.Trade_Show_Comments__c, k.Webinar_date__c, 
                      k.Webinar_request_date__c, k.Webinar_status__c from Lead_Key_Event__c k where Lead__c IN: leadIds Order By k.CreatedDate ASC];   
    
    
    
    
            //get the contact associated with the lead
    Contact[] contacts = [select Id , Last_KE_Date__c , CPM_Autodemo__c , White_Paper_Download__c,
              Contact_Sales_Request_Form__c,Purchase_Decision_Pending__c ,Recorded_Webinar__c,
              Webcast__c,Webinar__c, AccountId,pi__score__c
                         from Contact Where Id IN :conIds ];
                         
    //set the contact map                     
    For(Contact con : contacts)
    {
      contactMap.put(con.Id,con);
    }
    
    //run through all the lead key events and create corresponding key events for contacts/accounts
    For(Lead_Key_Event__c ke : leadKeyEvents)
    {
      Lead leadObject = leadMap.get(ke.Lead__c);
      Contact contactObject = contactMap.get(leadObject.ConvertedContactId);
    
      Key_Event__c keyEvent = new Key_Event__c();
      keyEvent.Contact__c = contactObject.Id;
      keyEvent.Account__c = contactObject.AccountId;
      keyEvent.Auto_Demo_Field_1__c = ke.Auto_Demo_Field_1__c;
      keyEvent.Auto_demo_Field_2__c = ke.Auto_demo_Field_2__c;
      keyEvent.Best_time_to_contact_prospects__c = ke.Best_time_to_contact_prospects__c;
      keyEvent.Contact_Sales_Comments__c = ke.Contact_Sales_Comments__c;
      keyEvent.Key_Event_Type__c = ke.Key_Event_Type__c;
      keyEvent.Lead_Created_Date__c = ke.Lead_Created_Date__c;
      keyEvent.Name = ke.Name;
      keyEvent.Primary_Business_Pain__c = ke.Primary_Business_Pain__c;
      keyEvent.Purchase_decision_timeframe__c = ke.Purchase_decision_timeframe__c;
      keyEvent.Score__c = ke.Score__c;
      keyEvent.Trade_Show_Comments__c = ke.Trade_Show_Comments__c;
      keyEvent.Webinar_date__c = ke.Webinar_date__c;
      keyEvent.Webinar_request_date__c = ke.Webinar_request_date__c;
      keyEvent.Webinar_status__c = ke.Webinar_status__c;
      keyEvent.Appt_Scheduled_Date__c = ke.Appt_Scheduled_Date__c;
      keyEvent.Lead_Confirmed_by_RM_NAM__c = ke.Lead_Confirmed_by_RM_NAM__c;
      
      String recTypeToSearch;
      
      if(keyEvent.Name == 'Auto Demo')
        recTypeToSearch = 'Key Event Auto Demo';
      if(keyEvent.Name == 'Auto Demo Click Through')
        recTypeToSearch = 'Key Event Auto Demo';
      if(keyEvent.Name == 'White Paper Download')
        recTypeToSearch = 'Key Event White Paper Download';
      if(keyEvent.Name == 'Contact Sales request form')
        recTypeToSearch = 'Contact Sales Request form layout';
      if(keyEvent.Name == 'Purchase Decision pending')
        recTypeToSearch = 'Purchase decision pending';
      if(keyEvent.Name == 'Recorded Webinar')
        recTypeToSearch = 'Recorded webinar';
      if(keyEvent.Name == 'Webcast Attendence')
        recTypeToSearch = 'Webcast attendence';
      if(keyEvent.Name == 'Webinar Request')
        recTypeToSearch = 'Webinar Request';
      if(keyEvent.Name == 'Trade Show')
        recTypeToSearch = 'TradeShow';
      if(keyEvent.Name == 'Webinar Attendence')
        recTypeToSearch = 'Webinar Attendence';
      if(keyEvent.Name == 'Webinar Registration')
        recTypeToSearch = 'Webinar Registration';
      if(keyEvent.Name == 'Appointment Scheduled')
        recTypeToSearch = 'Appointment Scheduled';
      if(keyEvent.Name == 'Appointment Attended')
        recTypeToSearch = 'Appointment Attended';
        
      
      For(RecordType rec : recType)
        {
            if(rec.Name == recTypeToSearch)
                keyEvent.RecordTypeId = rec.Id;
        }
  
      if(contactObject.Last_KE_Date__c == null || (contactObject.Last_KE_Date__c < keyEvent.Lead_Created_Date__c))
        contactObject.Last_KE_Date__c = keyEvent.Lead_Created_Date__c;
      
      if(leadObject.pi__score__c != null)
        {
          if(contactObject.pi__score__c == null)
            contactObject.pi__score__c = leadObject.pi__score__c;
          else
            contactObject.pi__score__c += leadObject.pi__score__c;
        }
      
      List<Contact> refinedContacts = new List<Contact>();
      For(Integer i = 0 ; i < consToUpdate.size() ; i++)
      {
        if(consToUpdate[i].Id != contactObject.id)
        {
          refinedContacts.add(consToUpdate[i]);
        }
      }
      consToUpdate = refinedContacts;
      
      consToUpdate.add(contactObject);
      keyEventsToInsert.add(keyEvent);
      keyEventsToDelete.add(ke);
      
    }
      
    if(keyEventsToInsert.size() > 0)
      insert keyEventsToInsert;  
      
    if(consToUpdate.size() > 0)
      update consToUpdate;
      
    if(keyEventsToDelete.size() > 0)
      delete keyEventsToDelete;
}

 

 

 

 

Hi All,

 

Writing my first test class here and fallen at the first hurdle!

 

To be able to test my class I need to instantiate a load of test objects first of all, so I have written a little class to do that which works fine.

 

The class I want to test is a (will be a) shopping cart that does nothing but instantiate so far.

 

I've started writing the test class to go alongside for my TDD. First I've instantiated all the test objects and written my first test method. However, Force.com IDE complains that objects are not available in my class. So when I try to save  

 

 

@isTest
private class TMDR_ShoppingCartTest {



	testBuildObjects tbo = new testBuildObjects();
	Account a = tbo.createAccount();
	Contact c = tbo.createContact(a.id);
	Opportunity o = tbo.createOpportunity(a.id,c.id);
	OpportunityContactRole ocr = tbo.createOpportunityContactRole(c.id,o.id);
	OpportunityLineItem oli = tbo.createOpportunityLineItem(o.id);
	OpportunityLineItem oli2 = tbo.createOpportunityLineItem(o.id);
	OpportunityLineItem oli3 = tbo.createOpportunityLineItem(o.id);
		
	static testMethod void testInstantiate() {
			
			System.Debug('########Starting Shopping cart tests###########');
			TMDR_ShoppingCart cart = new TMDR_ShoppingCart(o.id);
		
	}

}

 

 

 

 Force.com complains that o.id does not exist!

 

This must be a simple one. Can you help?

 

TIA

 

 

 

 

hi,

 

I want to get some help in writing an SOQL query where the scenario is

 

i want the count of number of contacts where the account its related to have some field abc = true..

 

 

Hi. since january i do triggers and depoloy to production without doing a test class..

Today when im going to deploy one trigger, Production SF get me an error saying "Average test coverage across all Apex Classes and Triggers is 0%, at least 75% test coverage is required"..

 

I have tested the trigger on sandbox with real case - with insert records..

 

What can i do?

hi,

i need small clarification for the governor limit too many query row limit for a context. I know apex has a governor limit like number of query rows fetched in a context should not be more than 10000. I want to know the limitation is for a query or a sum of all the records for a class.

hi,

 

I am using Google Visualization API for custom Report building on Visualforce pages.IN order to display the data in a graph where i am calculating the yearly data like number of accounts created in this year.

 

I used select count() from Accounts where Lead_Created_Date__c = This_Year; query which fetches the details the count of number of accounts created in this year.

 

I am hitting a governor limit since i have more than 10,000 accounts created this year. I heard that API has no governor limits then why I am getting this limit.I am using this query in controller of the visualforce page.I know the controller is an apex component so i Am getting this limitations.

 

Do u have any alternative suggestions to go ahead with it.

Hi,

 

I am new to Salesforce. Help needed on writing test method. mu current method covers 44% please help to get it 75%.

 

	 	  public with sharing class TallySheetItems {

private ApexPages.StandardController controller {get; set;}

//added an instance varaible for the standard controller
Tally_Sheet__c TS;
String recordId;

public TallySheetItems(ApexPages.StandardController stdController)
{

recordId = stdController.getId();
TS = (Tally_Sheet__c) stdController.getRecord();
this.controller=stdController;  
 
}


                List<TS_NASAAC_Item__c> TallySheetItemList;
                List<TS_NASAAC_Item__c> TallySheetItemList1;
                public double total { get; set; }
                public PageReference reset() {
                     TallySheetItemList= [select ID, MELT__c, BND__c, GR_WT_KGS__c, Tare__c,
                     NET_WT_KGS__c, Melt_Date__c, INGOTS__c, Ref__c, IsDeleted__c from
                     TS_NASAAC_Item__c where Tally_Sheet_Ref__c = :TS.ID and IsDeleted__c = false order by CreatedDate limit 100 ];
                     
                     
                     return null;
                }  
             
                public List<TS_NASAAC_Item__c> getTallySheetItems() {
                     if(TallySheetItemList== null) reset();
                     return TallySheetItemList;
                }
 
                public void setTallySheetItems(List<TS_NASAAC_Item__c> TallySheetItems) {
                      TallySheetItemList = TallySheetItems;
                }
 
                public PageReference saveItem() {
                     total = 0;
                     for(TS_NASAAC_Item__c o: TallySheetItemList)
                     {           
                       if(o.GR_WT_KGS__c!= null)
                       {             
                       total += o.GR_WT_KGS__c;          
                       }
                     }    
                     TS.TOTAL__c = total;     
                     update TS;              
                      upsert TallySheetItemList;
                      reset();
                      return null;
                }
 
                public PageReference add() {
                                TS_NASAAC_Item__c TSI = new TS_NASAAC_Item__c();
                                TSI.Tally_Sheet_Ref__c = TS.ID;
                                TallySheetItemList.add(TSI);
                                return null;
                }
                
                //string RowID;
                //public String getRowID() {return this.RowID;}
                //public List<TS_NASAAC_Item__c> TSIlst { get; set; }              
                //public PageReference DeleteRow()
                //{
                //string RowID = ApexPages.CurrentPage().getParameters().get('RowID');
                
                //TallySheetItemDelList= [select ID, MELT__c, BND__c, GR_WT_KGS__c, Tare__c,
                    // NET_WT_KGS__c, Melt_Date__c, INGOTS__c, Ref__c from
                    // TS_NASAAC_Item__c where ID = :RowID limit 1];
      
               // if ( TallySheetItemDelList.size() > 0 )
                  //    {           
                  //      delete TallySheetItemDelList;   
                 //      }   
                       
                       
                // if for any reason we are missing the reference
                //if (RowID == null)
                //{
                  //return null;      }           
                  // find the account record within the collection      
                  //TS_NASAAC_Item__c tobeDeleted = null;      
                  //for(TS_NASAAC_Item__c a : TSIlst)       
                  //if (a.Id == RowID)
                  //{         
                   //tobeDeleted = a;         
                   // break;       
                    //}           
                     //if account record found delete it     
                     // if (tobeDeleted != null)
                     // {       Delete tobeDeleted;      }                  
                   //reset();           
                //delete TallySheetItemDelList;
               // return null;
                //}
                
                public PageReference ExportExcel()
                {
                 TS.Exported__c = true;
                 update TS;
                 PageReference customPage = Page.vfTallySheetExport;
                 customPage.setRedirect(true);
                 customPage.getParameters().put('id', recordId);
                 return customPage;
                }
                
                public string[] getheaders()
                {
                return new string [] {'Melt#', 'BND#', 'GR WT KGS', 'TARE', 'NET WT KGS', 'Melt Date', 'INGOTS', 'Ref#'} ;
                }
                
                public List<TS_NASAAC_Item__c> getTallySheetItems1() {
                     if(TallySheetItemList== null) reset1();
                     return TallySheetItemList;
                }
                
                 public PageReference reset1() {
                     TallySheetItemList= [select MELT__c, BND__c, GR_WT_KGS__c, Tare__c,
                     NET_WT_KGS__c, Melt_Date__c, INGOTS__c, Ref__c from
                     TS_NASAAC_Item__c where Tally_Sheet_Ref__c = :TS.ID and IsDeleted__c = false order by CreatedDate limit 100 ];
      
                     return null;
                }  
                
                 public PageReference Completed() {
                                TS.Completed__c = true;
                                 update TS;
                                return null;
                }
                
                
     /* Test Case */

static testMethod void myUnitTest() {
 
PageReference PageRef = Page.vfTallySheet;
test.setCurrentPage(PageRef);

Apexpages.Standardcontroller sc = new Apexpages.Standardcontroller(new Tally_Sheet__c());
 List<TS_NASAAC_Item__c> TallySheetItemList;
 List<TS_NASAAC_Item__c> TallySheetItemList1;
 

TallySheetItems controller = new TallySheetItems(sc);
controller.reset();

 TallySheetItemList = null;
controller.getTallySheetItems();

TallySheetItemList= [select ID, MELT__c, BND__c, GR_WT_KGS__c, Tare__c,
NET_WT_KGS__c, Melt_Date__c, INGOTS__c, Ref__c, IsDeleted__c from
TS_NASAAC_Item__c where Tally_Sheet_Ref__c = 'a06T0000008OAyE' and IsDeleted__c = false order by CreatedDate limit 100 ];

controller.add();
controller.ExportExcel();
controller.getheaders();
controller.reset1();
controller.Completed();         
controller.saveItem();

}

/* Test Case ends....*/

 
}

 

 

hey everyone,

 

I am trying to deploy an edited version of a class already scheduled in live salesforce.

 

I am getting the following errors:

errors

 

I have uploaded many small scheduling tasks and triggers into SF without test classes and they've gone through. However, this time i got a Deploy Error. Is there a work around without having to write a ton of test classes?

 

I have done extensive testing in the sandbox for my upload and it has been fine. The edits contained in NDA counter are really small for my the already up and running version in live SF.

 

any help is appreciated. 

  • August 23, 2010
  • Like
  • 0

Does anyone know the limits of API SOQL calls? I have an aggregate query that, when run inside a VF controller, gives out a Too many query rows (16,125) error. However, the same query ran from SOQLXplorer returns no error and shows me the data.

Ok, here is my issue.  I have 1 class that I am trying to get into production.   Just for simplicity I have only 1 method that returns a list of users.   With this one class I have a the test method, and I get 31% coverage. 

 

1.  Why is it that when I add more methods code coverage goes down?

 

2.  Why can I have my class with the 1 method and a test class completely empty and still have the same coverage as before?

 

3.  Please explain or point me in the right direction about the code coverage.

 

 

Thanks.

Can  any one help me out the step to configure force .com IDE

and also how to deploy the application in production  from sandbox

 

 

 

thanx in advance

hi is it possible to create a field on a custom object which gives the count of Accounts.Like this object should display all the numerical data.

 

field ---> Num Accounts  ---> should give the count of all accounts in the org.

 

I know reports help us to get this info But i need to get this for some other purpose.

Here's the trigger code:

 

trigger ConsecutiveShifts on Shift__c (after insert) {

//Counter will be used to increment the Date for each new shift
Integer Counter = 1;

for(Shift__c a : trigger.new)
{
    Decimal Consec_Shifts = a.Consecutive_Shifts__C;
    While(Consec_Shifts > 1){
        Shift__c b = New Shift__c();
        b.markets__c = a.markets__c;
        b.date__c = a.date__c + Counter;
        b.client__c = a.client__c;
        b.position__c = a.position__c;
        b.shift_start__c = a.shift_start__c;
        b.shift_end__c = a.shift_end__c;
        b.contractor__c = a.contractor__c;
        b.notes__c = a.notes__c;
        b.status__c = a.status__c;
        b.shift_cancelled__c = a.shift_cancelled__c;
        b.last_minute__c = a.last_minute__c;
        b.pic__c = a.pic__c;
        b.Consecutive_Shifts__c = 1;
        Counter++;
        insert(b);
        Consec_Shifts--;
    }
}
}

 

and here is what I thought would be sufficient testing for it...

 

 

 

@isTest
private class TestShift {

    static testMethod void TestShiftInsert() {
        // TO DO: implement unit test
          system.debug('in test method');
      Shift__c l = new Shift__c(Markets__c = 'a0VA00000005DLh', Client__c = '001A0000002KIGB',
      Position__c = 'RPH', Shift_Start__c = '11:00', Shift_End__C = '12:00', Contractor__c = '003A0000001rWdW', Notes__c = 'Testing',
      Consecutive_Shifts__C = 5, Status__C = 'Confirmed', Shift_Cancelled__C = True, Last_Minute__c = True, PIC__c = True);
        try
        {
        insert l;
        }
        catch(DmlException e){
          system.debug(e.getMessage() + 'testing the insertion of a shift.');
        }
    }
}

 

 

Since the trigger is procced off of an inserted shift, I made sure to insert one in my test class. The trigger functions great on my sandbox, I just need to have the testing in place to implement it into Salesforce. It's not showing any coverage for the trigger and I can't figure out why.

 

Thanks for any help!

Hello,

 

I tested the following code in Sandbox and it worked perfectly fine. Granted that the sandbox environment tends to ignore some Failures and Warnings that would otherwise be flagged when deploying to production. Which is exactly what I think is happening now when I try to deploy this code. Any help or suggestions on what i might be missing in this code would be greatly appreciated.

 

Code is as follows:

*********************

public class BUG_RelatedBug
{
    public static testmethod void test1()
    {
        BUG_RelatedBug obj = new BUG_RelatedBug();
        
        SFDC_Bug__c objBug = new SFDC_Bug__c();
        objBug.Problem__c = 'testBug';
        insert objBug;
        objBug.Problem__c= 'test';
                   
        SFDC_Related_Bug__c objRelatedBug = new SFDC_Related_Bug__c();
        objRelatedBug.SFDC_Bug__c = objBug.Id;
        insert objRelatedBug;
        
        obj.allBugs = objBug.Id;
        obj.bugId = System.currentPageReference().getParameters().get('id');
        obj.SaveAll();
        obj.goBack();
    }
    
    public BUG_RelatedBug()
    {
       try
       {
           bugId = System.currentPageReference().getParameters().get('id');
           bugName = [SELECT Name FROM SFDC_Bug__c WHERE SFDC_Bug__c.Id=: bugId LIMIT 1].Name;
       }
       catch(Exception ex)
       {
           // DO NOTHING
       }
    }
    
    public PageReference saveAll()
    {
        list<String> SplitBugArr = allBugs.split(',');
        list<SFDC_Related_Bug__c> listRelatedBug = new list<SFDC_Related_Bug__c>();
        if(SplitBugArr.size() > 0)
        {
            for(Integer i = 0; i < SplitBugArr.size(); i++)
            {
                SFDC_Related_Bug__c ObjRelatedBug = new SFDC_Related_Bug__c();
                ObjRelatedBug.SFDC_Bug__c = bugId;
                ObjRelatedBug.SFDC_Bug_Num__c = SplitBugArr[i];                       
                listRelatedBug.add(ObjRelatedBug);
                
                SFDC_Related_Bug__c ObjRelatedBug2 = new SFDC_Related_Bug__c();
                ObjRelatedBug2.SFDC_Bug__c = SplitBugArr[i];
                ObjRelatedBug2.SFDC_Bug_Num__c = bugId;                       
                listRelatedBug.add(ObjRelatedBug2);
                
                SFDC_Bug__c[] UpdateBug = [SELECT Name FROM SFDC_Bug__c WHERE SFDC_Bug__c.Id=: bugId LIMIT 1];
                if (UpdateBug.size()>0)
                {UpdateBug[0].Status__c = 'Pending - BUG';
                update UpdateBug;
                }
                               
               
            }
            
        }
        if(listRelatedBug.size() > 0)
        {
            insert listRelatedBug;
        }
        return goBack();
    }
    
   public pageReference goBack()
   {
       PageReference pageRef = new PageReference('/'+bugId);
       pageRef.setRedirect(true);
       return pageRef;
   }
    
    
    
    public string bugId
    {
        set
        {
            bugId = value;
        }
        get
        {
            return bugId;
        }
    }
    public string bugName
    {
        set
        {
            bugName = value;
        }
        get
        {
            return bugName;
        }
    }
     public string allBugs
     {
        set
        {
           allBugs = value;
        }
        get
        {
           return allBugs;
        }

     }
     
}

****************

 

I get the following Error Message:

 

"System.DmlException:Insert Failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [SFDC_Bug__c]: [SFDC_Bug__c]"

 

 

Thanks in Advance.