Skip to main content
deleted 12 characters in body; edited tags
Source Link
Chris Duncombe
  • 24.3k
  • 13
  • 77
  • 116

I have a custom field in my account called Priority (picklist) I have a lookup to Account in a custom object called Customer. I want to access Account.Priority but it always returns null even though I made 100% certain that the pick-list is filled in.

for ( Customer__c c : Trigger.new )
    {
        //Customer__c has one field, invisible to all viewers, that is filled with the uniqueID (Title FirstName LastName). It is then checked against the database to see if there are entries with the same uniqueID
        c.Unique_Id__c    = c.Title__c + ' ' + c.First_Name__c + ' ' + c.Last_Name__c;

        //debugging purposes: Check to see if priority has a value stored inside.
        c.Address__c = 'priority: ' + c.Account__r.Priority__c;

        customers.put( c.Unique_Id__c, c );        
    }

anyAny ideas what I'm doing wrong here? Thanks in advance.

I have a custom field in my account called Priority (picklist) I have a lookup to Account in a custom object called Customer. I want to access Account.Priority but it always returns null even though I made 100% certain that the pick-list is filled in.

for ( Customer__c c : Trigger.new )
    {
        //Customer__c has one field, invisible to all viewers, that is filled with the uniqueID (Title FirstName LastName). It is then checked against the database to see if there are entries with the same uniqueID
        c.Unique_Id__c    = c.Title__c + ' ' + c.First_Name__c + ' ' + c.Last_Name__c;

        //debugging purposes: Check to see if priority has a value stored inside.
        c.Address__c = 'priority: ' + c.Account__r.Priority__c;

        customers.put( c.Unique_Id__c, c );        
    }

any ideas what I'm doing wrong here? Thanks in advance

I have a custom field in my account called Priority (picklist) I have a lookup to Account in a custom object called Customer. I want to access Account.Priority but it always returns null even though I made 100% certain that the pick-list is filled in.

for (Customer__c c : Trigger.new) {
        //Customer__c has one field, invisible to all viewers, that is filled with the uniqueID (Title FirstName LastName). It is then checked against the database to see if there are entries with the same uniqueID
        c.Unique_Id__c    = c.Title__c + ' ' + c.First_Name__c + ' ' + c.Last_Name__c;

        //debugging purposes: Check to see if priority has a value stored inside.
        c.Address__c = 'priority: ' + c.Account__r.Priority__c;

        customers.put(c.Unique_Id__c, c);        
    }

Any ideas what I'm doing wrong here? Thanks in advance.

I have a custom field in my account called Priority (picklist) I have a lookup to Account in a custom object called Customer. I want to access Account.Priority but it always returns null even though I made 100% certain that the pick-list is filled in.

for ( Customer__c c : Trigger.new ) { //Customer__c has one field, invisible to all viewers, that is filled with the uniqueID (Title FirstName LastName). It is then checked against the database to see if there are entries with the same uniqueID c.Unique_Id__c = c.Title__c + ' ' + c.First_Name__c + ' ' + c.Last_Name__c;

for ( Customer__c c : Trigger.new )
    {
        //Customer__c has one field, invisible to all viewers, that is filled with the uniqueID (Title FirstName LastName). It is then checked against the database to see if there are entries with the same uniqueID
        c.Unique_Id__c    = c.Title__c + ' ' + c.First_Name__c + ' ' + c.Last_Name__c;

        //debugging purposes: Check to see if priority has a value stored inside.
        c.Address__c = 'priority: ' + c.Account__r.Priority__c;

        customers.put( c.Unique_Id__c, c );        
    }

any ideas what I'm doing wrong here? Thanks in advance

I have a custom field in my account called Priority (picklist) I have a lookup to Account in a custom object called Customer. I want to access Account.Priority but it always returns null even though I made 100% certain that the pick-list is filled in.

for ( Customer__c c : Trigger.new ) { //Customer__c has one field, invisible to all viewers, that is filled with the uniqueID (Title FirstName LastName). It is then checked against the database to see if there are entries with the same uniqueID c.Unique_Id__c = c.Title__c + ' ' + c.First_Name__c + ' ' + c.Last_Name__c;

    //debugging purposes: Check to see if priority has a value stored inside.
    c.Address__c = 'priority: ' + c.Account__r.Priority__c;

    customers.put( c.Unique_Id__c, c );        
}

any ideas what I'm doing wrong here? Thanks in advance

I have a custom field in my account called Priority (picklist) I have a lookup to Account in a custom object called Customer. I want to access Account.Priority but it always returns null even though I made 100% certain that the pick-list is filled in.

for ( Customer__c c : Trigger.new )
    {
        //Customer__c has one field, invisible to all viewers, that is filled with the uniqueID (Title FirstName LastName). It is then checked against the database to see if there are entries with the same uniqueID
        c.Unique_Id__c    = c.Title__c + ' ' + c.First_Name__c + ' ' + c.Last_Name__c;

        //debugging purposes: Check to see if priority has a value stored inside.
        c.Address__c = 'priority: ' + c.Account__r.Priority__c;

        customers.put( c.Unique_Id__c, c );        
    }

any ideas what I'm doing wrong here? Thanks in advance

Source Link

get a custom field from a lookup relation

I have a custom field in my account called Priority (picklist) I have a lookup to Account in a custom object called Customer. I want to access Account.Priority but it always returns null even though I made 100% certain that the pick-list is filled in.

for ( Customer__c c : Trigger.new ) { //Customer__c has one field, invisible to all viewers, that is filled with the uniqueID (Title FirstName LastName). It is then checked against the database to see if there are entries with the same uniqueID c.Unique_Id__c = c.Title__c + ' ' + c.First_Name__c + ' ' + c.Last_Name__c;

    //debugging purposes: Check to see if priority has a value stored inside.
    c.Address__c = 'priority: ' + c.Account__r.Priority__c;

    customers.put( c.Unique_Id__c, c );        
}

any ideas what I'm doing wrong here? Thanks in advance