Formula to lookup non-related table

Posted by Rollbase User on 13-Jul-2010 01:29

Hi Guys, If I have two objects that are not directly related, how can I create a trigger that pulls a string from one into the other. In the attached diagram, I want to pull the broker code into the application object (either with a formula field, or trigger). In other words, the formula will be saying 'give me the broker code from the broker credentials object where lender is application.lender and broker is application.broker.

All Replies

Posted by Admin on 13-Jul-2010 11:22

If you create related field BrokerCode on Lender object you can than use that field's value to populate text field on Application object.

Hope that will help.

Posted by Admin on 13-Jul-2010 18:07

Hi Pavel,



This can't be done, because there is Many credentials for each lender. Similarly, it can't be done on the broker object either, since there is many credentials per broker (one for each lender).



To get the broker code, you need to be able to select the row from the credentials table where the lender is equal to the lender for the application AND the broker is equal to the broker for the application.



The broker credentials table would contain data like this:



ANZ Matt 542125

CBA Matt 548899

ANZ Linda 447788

CBA Linda 558774

Posted by Admin on 13-Jul-2010 18:17

Than you can try out Query API, which can be used in formulas (including triggers):


rbv_api.selectValue(query);


In your case query will probably look like this:

SELECT BrokerCode FROM BrokerCerdentials WHERE Lender=... AND Broker=...


You can use regular template tokens like
{!id}
inside query to make it useful.

This thread is closed