Skip to main content

Timeline for Iterate over queried lookup fields

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
Mar 7, 2016 at 14:39 history edited Adrian Larson CC BY-SA 3.0
added 48 characters in body
Feb 16, 2016 at 17:09 comment added Adrian Larson Glad it helped you. It has saved me many hours of work myself! :)
Feb 16, 2016 at 17:08 comment added Avinash FieldReference class worked without even single change. Thank you very much.
Feb 16, 2016 at 17:06 vote accept Avinash
Feb 16, 2016 at 16:50 history edited Adrian Larson CC BY-SA 3.0
added 542 characters in body
Feb 16, 2016 at 2:54 comment added Adrian Larson @AvinashN It is a lot to grep at once, but using it is pretty simple. You just pass it a string, and once you have it constructed, call getFrom. If you want to write your own version though, then you would need to understand it before knowing what you might do differently.
Feb 16, 2016 at 2:52 comment added Avinash Adrian, Sorry about that. I thought you posted the answer for one level relationship and I felt I didn't give enough information. So I updated the question and added comments for both the answers with my exact scenario. I'm going through the FieldReference class. I'll let you know once I use it for my scenario. Thanks.
Feb 16, 2016 at 2:45 comment added Adrian Larson @AvinashN You've clearly just copy-pasted this comment from the other answer. I don't see how it is relevant, the included code is perfectly flexible enough to suit your needs.
Feb 16, 2016 at 2:43 comment added Avinash Adrian, even though the example I've give is very simple, In the code I'm working on, I've around 40 fields across 5 different look ups, ranging from 3-5 level deep relationships (Ex: Invoice__r.Task__r.Account.Contact.FirstName). I'm querying Opportunity(the base object) and I need to make sure the FirstName on contact is not null.
Feb 16, 2016 at 2:34 history answered Adrian Larson CC BY-SA 3.0