• CSchaez
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies

I have no idea how to remove or deactivate a trigger that is deployed to production... Everything I have is working properly right now, but I worry that if something goes wrong and freezes a system, I won't be able to remove my code. Could someone walk me through the process?

 

Thanks!

Charlie

my lead field incrementField__c is a number field with default value of 0. However, here when I try to increment it, It says that I am de-referencing a null object (even though the value is 0, not null). I think I may be calling the field value incorrectly, but I'm not quite sure how to get this to work properly. Any help would be greatly appreciated

 

*I'm pretty new to this, so I apologize if i am missing the obvious

 

trigger incrementStuff on Task(before insert)
{
    private Task[] newTask = Trigger.new;
    string subject = newTask[0].Subject;
    subject.toLowerCase();
    if    (subject.contains ('stuff'))
        newTask[0].bool__c = false;
  

    else
    {
        newTask[0].bool__c=true;
        string realId = newTask[0].WhoId;
        realId = realId.substring(0,15);           //For some reason, when I pull WhoId it attaches a few Lead    

        parent = new Lead(Id = realId); //random  digits, so here I workaround      
        parent.incrementField__c = parent.incrementField__c + 1;
        update parent;
    }
   
}

I'm fairly new to apex, so if this is really simple and I am just missing it, I apologize.

 

What I'm trying to do is take a boolean value field from the activity, use it to increment a field in the associated lead, and then toggle the boolean. Any help would be awesome.

my lead field incrementField__c is a number field with default value of 0. However, here when I try to increment it, It says that I am de-referencing a null object (even though the value is 0, not null). I think I may be calling the field value incorrectly, but I'm not quite sure how to get this to work properly. Any help would be greatly appreciated

 

*I'm pretty new to this, so I apologize if i am missing the obvious

 

trigger incrementStuff on Task(before insert)
{
    private Task[] newTask = Trigger.new;
    string subject = newTask[0].Subject;
    subject.toLowerCase();
    if    (subject.contains ('stuff'))
        newTask[0].bool__c = false;
  

    else
    {
        newTask[0].bool__c=true;
        string realId = newTask[0].WhoId;
        realId = realId.substring(0,15);           //For some reason, when I pull WhoId it attaches a few Lead    

        parent = new Lead(Id = realId); //random  digits, so here I workaround      
        parent.incrementField__c = parent.incrementField__c + 1;
        update parent;
    }
   
}

I'm fairly new to apex, so if this is really simple and I am just missing it, I apologize.

 

What I'm trying to do is take a boolean value field from the activity, use it to increment a field in the associated lead, and then toggle the boolean. Any help would be awesome.