• Luis Gutierrez
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I havent coded apex in a long time, this trigger was working for the past 8 months and then all the sudden we get this:

 

 

Apex script unhandled trigger exception by user/organization: 005U0000000fp0q/00DU0000000Kh8N

 

changeLeadStatus: execution of BeforeInsert

 

caused by: System.NullPointerException: Attempt to de-reference a null object

 

Trigger.changeLeadStatus: line 7, column 1

 

 

Any help would eb appricated

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

trigger changeLeadStatus on Task (before insert, before update) {
    String desiredNewLeadStatus = 'Working - Contacted';

    List<Id> leadIds=new List<Id>();
    for(Task t:trigger.new){
        if(t.Status=='Completed'){
            if(String.valueOf(t.whoId).startsWith('00Q')==TRUE){//check if the task is associated with a lead
                leadIds.add(t.whoId);
            }//if 2
        }//if 1
    }//for
    List<Lead> leadsToUpdate=[SELECT Id, Status FROM Lead WHERE Id IN :leadIds AND IsConverted=FALSE];
    For (Lead l:leadsToUpdate){
        l.Status=desiredNewLeadStatus;
    }//for
    
    try{
        update leadsToUpdate;
    }catch(DMLException e){
        system.debug('Leads were not all properly updated.  Error: '+e);
    }
}//trigger

Im fairly new to salesforce and have such a basic question that has been frustrating me for a long time! Im using Salesforce Unlimited account.

 

I am setting up our salesforce accounts and I cant decide which is the best record type to use, Traditional or Person accounts. Normally we have Accounts that have multple contacts assoicated with them. Am i limited to traditional accounts?

 

Thanks,

Luis

I have a small salesforce (roughly 40 users) site (using Enterprise version for wealth management).

We use a consulting firm to developed our site and I just got a price for some custom coding. They want $5,600 to do the following work. I just want to know is this a reasonable price or am I getting overcharged?

Auto update Lead status

Requirements:

-          Auto update lead status after a note is added to the Notes field, or a call is logged)

-          Whenever a User adds a Note to the custom Note object on a Lead and the Lead Status = ‘Open – Not Contacted’, the Lead Status will need to update to ‘Open – Contacted’

-          This can be accomplished via an Apex trigger that will look at the Status of the Lead when the Note is created and update the status appropriately.

 

Redirect User to parent record after creation of Note

Requirements:

-          The Note object is a custom object that is related to the Accounts, Contacts, Leads, and Companies – Leads objects.

-          Currently when a user adds a Note to the Note object, when they save the Note the Note detail page is displayed.

-          Alamo Capital would like the user to be taken back to the parent record (Account, Lead, etc.) when the Note is saved instead of the Note detail page.

-          This can be accomplished with a Visualforce/Apex override of the Save button that will create the Note record and redirect the user to the parent record

 

Project is structured as time and materials.

 

All invoices are due Net 15.

 

Schedule and Pricing

 

Rate: $175/hour

Estimated Hours: 32 Hours

Total for consulting hours: $5,600