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
chriscwharrischriscwharris 

Alternatives to Vlookup for use in formula field?

So coming from another development platform I am finding a lot of limitations in retrieving data for use in forms from other records (objects). When I found Vlookup I thought I had discovered my saviour, a way to lookup unrelated data for use in a form, but sadly it soon became clear it was only for use in validation formulas.

Is there an alternative that allows lookup of data from another object that is not "related" via a lookup or master/detail relationship? Why would I want that? Well for example, looking up a value or values from a currency object using a currency code without making the 2 objects related as the currency records are global and accessed from lots of objects etc... This is just on example so don't fixate on currency data, it could be getting a set of values using the value of a picklist to drive the lookup of that data. Thanks
SarfarajSarfaraj
Unfortunately you cannot do that with configuration. However you may refer unrelated data using custom code. For example you may write a before insert and before update trigger on your target object to query other unrelated objects on save of a record and do the necessary data population as per your requirement.
chriscwharrischriscwharris
Is it possible if I was to develop a piece of visuaforce and use SOQL? Could I for example in a VF page, pick a value from a drop down and then refresh the value of a number of fields on the front end using a partial refresh? Ajax or similar?
SarfarajSarfaraj
Yes this is what is was referring to. You have to create one VF page. Onchange of your driving field you need to refresh your target field to populate appreciate value. Please find below a nice page on partial page refresh. If you have any doubt please feel free to get back to me. http://srinivas4sfdc.blogspot.in/2013/08/visualforce-sample-dynamic-edit-page_3.html?m=1
chriscwharrischriscwharris
Thanks, I'll check this out today