You need to sign in to do that
Don't have an account?
Ross James
Trigger checking for an Empty Lookup Field
I am having problems with a simple IF statement and Lookup Fields. How do I ask if the Lookup Field Membership_Number__c is empty.
This is my code, but all records, with or without a Membership Number are going to the else.
if (ili.Product_Family__c=='Membership') { if (ili.Account_Name__r.Membership_Number__c==NULL) { InvoiceLineItemPaid.AddMembership((String)ili.Id); } else { InvoiceLineItemPaid.AddMembershipLineItem((String)ili.Id); }
Have you checked if that field is empty (vs NULL)? Why not add a System.debug statement to output the value of the Membership_Number__c field so you can see it in the debug logs and verify its value.