Auto Linking Related Records

Posted by Rollbase User on 23-Mar-2012 12:34

I have a one-to-many relationship between two Objects: Object A (Parent) Object B (Child) I have a process in which I upload new records into Object B......once the new records are within Object B...I have a formula field within Object B that combines multiple fields within Object B......the results of this formula field identifies which Parent record the Child record is related...... What is the best method for "auto" linking my child record to the parent record..... thank you

All Replies

Posted by Admin on 23-Mar-2012 19:01

Hi,



Use a trigger after create to look for the uploaded child's parent.

Use your formula field within this trigger .

Make sure when uploading into Rollbase use normal mode so that triggers run.



Piscoso, Martin

Rollbase ph

Posted by Admin on 09-Apr-2012 08:19

Relationship Trigger



if ("{!fieldA}" == "ABC123" && "{!FieldB}">0 && "{!R49149978.FieldC}" == "{!FormulaFieldC}" )

return "{!R49149978.id}";



I'm trying to create a trigger that will auto link/create relationship Object B (child) to Object A (parent).......



If certain conditions are met in Object B ("{!fieldA}" == "ABC123" && "{!FieldB}">0 -----

Then I want to use a formula field in Object B --{!FormulaFieldC}-- to find where --{!FormulaFieldC}-- is = to a unique field ---{!R49149978.FieldC}---located in Object A ---



and return Object A's ID field ----- "{!R49149978.id}"



and create the relationship.



I'm not able to get this to work......thanks for any advice.



Posted by Admin on 10-Apr-2012 20:28

Have you tried returning the ID without any conditions to test if you are inputting it in the correct relationship . This may be several things, either the conditions are blocking the return or the input on that relationship field is not meant for that field e.g wrong relationship .



Additionally please use the validate and debug formula options under your trigger's formula body so it will be easier to debug.

This thread is closed