• Christopher Littlefield 6
  • NEWBIE
  • -1 Points
  • Member since 2016
  • CRM Manager
  • UNE Online

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I am trying to delete a trigger on an Object that is no longer really being used.  The person who created it is no longer with the company.  I am not a developer and am having a heck of a time trying to deactivate this trigger using sandbox to production deployment.  This is holding up an installation that is supposed to happen this weekend.
I believe I need a test for the following trigger that I am trying to deactivate, but my code coverage is too low.  I'm desperate at this point because it is holding up an install.

trigger ConvertLeadToContact on Lead (after update) {
//cbl code to comment the trigger code 1/26- add this line and line below
/*
  
  List<Lead> leadsToConvert = new list<Lead>();
  for(Lead l: Trigger.new){
    if(l.Program__c == 'SPHP')
      if(!l.isConverted)
        leadsToConvert.add(l);
  }
  
  Id acctId = null;
  List<Account> acctList = [
    SELECT Id 
    FROM Account 
    WHERE Name = 'CGPS Bucket' AND Program_Email__c = 'owladmissions@une.edu'
  ];
  if (acctList.size() == 1)
    acctId = acctList[0].Id;

  LeadStatus convertStatus = [
    SELECT Id, 
    MasterLabel 
    FROM LeadStatus 
    WHERE IsConverted = true 
    LIMIT 1
  ];

  List<Database.LeadConvert> leadConverts = new list<Database.LeadConvert>();
  for(Lead l : leadsToConvert){
    Database.LeadConvert lc = new database.LeadConvert();
    lc.setLeadId(l.Id);
    lc.setConvertedStatus(convertStatus.MasterLabel);
    lc.setDoNotCreateOpportunity(true);
    lc.setAccountId(acctId);
    leadConverts.add(lc);
  }

  if(!leadConverts.isEmpty()){ 
    Database.LeadConvertResult[] lcrList = Database.convertLead(leadConverts, false);
    for(Database.LeadConvertResult lcr : lcrList)
      System.assert(lcr.isSuccess());
  }
 */
 //End of comment line code - add this line and also the line above which has */
}
I believe I need a test for the following trigger that I am trying to deactivate, but my code coverage is too low.  I'm desperate at this point because it is holding up an install.

trigger ConvertLeadToContact on Lead (after update) {
//cbl code to comment the trigger code 1/26- add this line and line below
/*
  
  List<Lead> leadsToConvert = new list<Lead>();
  for(Lead l: Trigger.new){
    if(l.Program__c == 'SPHP')
      if(!l.isConverted)
        leadsToConvert.add(l);
  }
  
  Id acctId = null;
  List<Account> acctList = [
    SELECT Id 
    FROM Account 
    WHERE Name = 'CGPS Bucket' AND Program_Email__c = 'owladmissions@une.edu'
  ];
  if (acctList.size() == 1)
    acctId = acctList[0].Id;

  LeadStatus convertStatus = [
    SELECT Id, 
    MasterLabel 
    FROM LeadStatus 
    WHERE IsConverted = true 
    LIMIT 1
  ];

  List<Database.LeadConvert> leadConverts = new list<Database.LeadConvert>();
  for(Lead l : leadsToConvert){
    Database.LeadConvert lc = new database.LeadConvert();
    lc.setLeadId(l.Id);
    lc.setConvertedStatus(convertStatus.MasterLabel);
    lc.setDoNotCreateOpportunity(true);
    lc.setAccountId(acctId);
    leadConverts.add(lc);
  }

  if(!leadConverts.isEmpty()){ 
    Database.LeadConvertResult[] lcrList = Database.convertLead(leadConverts, false);
    for(Database.LeadConvertResult lcr : lcrList)
      System.assert(lcr.isSuccess());
  }
 */
 //End of comment line code - add this line and also the line above which has */
}

HI All ,

 

I am facing a issue reagrding the field update from apex.

 

System.DmlException: Update failed. First exception on row 0 with id 800c00000001DvXAAU; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Status: bad value for restricted picklist field: Active: [Status]

 

I have provide all the permissions for the field. but still facing the above issue.

 

Please help!!!..

 

Thanks

Shailu

 

  • July 26, 2013
  • Like
  • 0