function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JoyceyJoycey 

Lookup from object

Hi all, I am very new to this so please bare with me.

 

I have created an object which holds data about specific post codes. What I want to do is dependant on the postcode in the account object, is return a result based on whether this postcode from the account is referenced in this other object. Much like the lookup function in Excel.

 

So the thought process is, if this new account postcode has a match in my object then return a result. If not leave blank.

Many thanks in advance for your help.
Nick

Ranu JainRanu Jain

Hii Joycey,

 

Can I know where you are using this functionality in class or trigger ?

You are working on bulk data or simply one record?

 

You can do it by applying queries and looping.

 

JoyceyJoycey

Ranu

Many thanks for your reply.

This will be done on one record at a time. I was trying to do it at field level, but it seems using a VLOOKUP in this way isnt possible.

I then tried using it as a trigger, but I get an error saying that a fieldname is requested. This is what my query looks like, in triggers 

VLOOKUP  (LSOA_AreaLink__r.Scheme__c,  LSOA_AreaLink__r.LSOA_Name__c,  LSOA_Area__c)

 I would welcome any suggestions.

Many thanks

Nick