Updating Related Record with Multiple Values From Lookup

Posted by Rollbase User on 18-Jul-2010 05:26

I am trying to update a field in a related record each time there is a change i.e. to keep the values in the two objects synchronised. The field that i want to synch links to the user object. Sinc the record has many to mny relationship, I am trying to update the field in the related record with all the user names in the parent record. This is the code (the words in been ** ** are for info only var x; {!#LOOP_BEGIN.R11525747} x = new Array(); x["R11973520"] **This field is a lookup to User in related record**= {!R11525697}; **This field contains many user names that need to be updated in the related record** rbv_api.updateRecord("DD_DATA_OBJECT", {!R11525747.id}, x); {!#LOOP_END.R11525747} I don't believe this is a bug, but instead a syntax issue. Any help or guidance with the syntax would be appreciated. The error message is attached.

All Replies

Posted by Admin on 18-Jul-2010 11:28

Lookup field returns null when no relationship is set. If you need to have a number try parseInt(" ...")

You can also use new API rbv_api.attach()

Posted by Admin on 18-Jul-2010 11:30

Try {!R11525697#id}, this should default empty values to "0".

This thread is closed