+ Start a Discussion
erikrusselerikrussel 

Related Field Between Objects Help

When attetempting to pass a field value from one object (cutom object) to a another object (Lead) does the related field need to be a Unique ID?  If the custom object is an installed package and doesn't already contain a unique ID field can I create a lookup field and use that a related field?

 

Thanks

Erik

Ritesh AswaneyRitesh Aswaney

THe lookup field contains the Salesforce Id of the related object in the background. You should be able to use the default Salesforce Id field to relate, even though the object may be part of a managed package.

erikrusselerikrussel

So I have a custom object called Postal_Code.  I want to pass the sundog_deprm2__County__c field to a lead field.  Only the postal code object and lead object are not related.  So if I write a trigger I don't know how do this 

 

if(l.CommonLookupField != null) {

 

I don't know what field to put in CommonLookupField?  Any ideas?

 

Thanks in advance

Erik

Ritesh AswaneyRitesh Aswaney

If you're looking to relate a Lead with a Postal_Code__c (Many to One, i.e. Many Leads can relate to One Postal_Code__c) , you would need a Postal_Code__c lookup field on Lead. This lookup field would hold the Id of the related Postal_Code__c record.