mass update of records in one object because of an update in

Posted by Rollbase User on 06-Jan-2010 01:37

What is the best way to do mass updates? Scenario: two objects are related to one another. A field in the first object is updated and with that, a field in the second object has to be updated also. However, not all entries have to be updated, it still depends on a certain criteria. The relationship between first and second object is 1:M so, the trigger "Update Field Value" will not work. I thought "Update Related Records" should do the trick but this trigger triggers all after update triggers of second object which is not appropriate and might cause problems. In this respect, what is the best way to implement this scenario? (Does my question even make sense?)

All Replies

Posted by Admin on 06-Jan-2010 09:35

OK, you have objects A and B with 1-N relationship. But you only want to update related Bs with amount>1000. So you can write a trigger on A update. Select "Update related Bs". Than write a trigger's formula, something like that:


if ({!amount} > 1000) return .....
else return null;

If this formula returns null, record's field will not be updated. Otherwise it will.

Posted by Admin on 06-Jan-2010 18:01

I don't understand... there seems to be problems:

1. The formula return type for "update related records" is boolean; not the type that is needed in the problem (decimal)
2. the trigger property says "Select related object(s) for which this trigger should run all On After Update triggers." Does it not mean that this trigger will fire "after update" triggers of object B?

Posted by Admin on 06-Jan-2010 18:04

another thing: "Update related records" trigger does not provide a way to specify which field/s should be updated by the trigger. Even if the formula returns Decimal, it does not state what field to update.

Posted by Admin on 06-Jan-2010 18:49

You don't need "Update related records" trigger. I'm talking about "Update field value" trigger.

Posted by Admin on 06-Jan-2010 19:20

hmm.... again, that's a problem. Actually, i first tried "Update field value" trigger. in the "Select record to update: A or related record" only A is in the list. B is not there. That is when I stumbled on "Update Related Records"

Posted by Admin on 06-Jan-2010 19:25

i had the impression that "Update field value" only changes one record and not records as the description says "Update the value of a Field in this Record or a Related Record"

anyhow, i will work on this update field value instead. and will test it. will give feedback

Posted by Admin on 06-Jan-2010 19:47

 The problem is with "Update field value" trigger interface. Though A has relation with B, only A is in the drop-down list in Trigger properties -> select record to update. Thus B's field cannot be updated

Posted by Admin on 06-Jan-2010 21:33

You're right, sorry for confusion. Currently "Update field value" only works for N-1 or 1-1 relationships (when other side of update is uniquely identified). I can consider this as feature request, will try to accommodate ASAP.
What's your zone name?

Posted by Admin on 06-Jan-2010 23:44

alright! thanks for the clarification! will wait for this till it's available. :)

Posted by Admin on 07-Jan-2010 00:15

This should be available now, please try.

This thread is closed