Reverse Look-up Field

Posted by Rollbase User on 22-Mar-2012 15:03

Is it possible to populate a parent record text field with data (text field) from a related child record? Basically Populate [Text field A] on the Parent Record.....with the data found in [Field B] located on the related Child record.....When [Field C] on the Child Record is Checked....otherwise leave [Text field A] on the Parent Record "blank" Thanks is advance for help

All Replies

Posted by Admin on 22-Mar-2012 15:44

I think yes - use client-side API (chapter 7).

Posted by Admin on 23-Mar-2012 10:49

Pavel,



Thank you for the reply. Can you provide any examples? I'm new to Rollbase....this would be a BIG HELP...if I can accomplish....thank you.

Posted by Admin on 26-Mar-2012 13:42

Pavel,



In reviewing chapter 7...I found the following...



rbf_getRelatedFields(relName, id, fieldName, callback)

This method retrieves the values of selected field for records related for a selected Rollbase record.



Is the API query I would use? If yes, can you give me an example of the code.....I would use to make the API call.....I'm new to Rollbase....I really appreciate your help.....



thanks

Posted by Admin on 26-Mar-2012 16:02

Yes, this should work.

Posted by Admin on 26-Mar-2012 20:01

Hi,



Try using a trigger on the Child record on create/update.

Trigger Type: Update Field Value

Object to update: Parent Object -- Look for this in the dropdown

Field to update: Parent Text field A -- Look for this in the dropdown



Formula Body:



As said by Pavel in a different post, make use of the dropdown helpers on top of the formula body so that you don't get any wrong syntax calls on your tokens.



Using this method on the Child record would lessen your code on the parent record since logically it should be the Child updating the Parent in this scenario.



Just make sure that on the child object, the Parent Lookup/Record should be required. If it is not, you will have to add additional handling to avert errors ^_^



Piscoso Martin

Rollbase PH

Posted by Admin on 27-Mar-2012 11:33

Martin,



Yeeeee Hiiiiii!!!!!!! Thank you for your help. it worked.... you da man

Posted by Admin on 27-Mar-2012 13:08

Thanks Martin!

This thread is closed