[V4.5 and beta V5.0] - Setting multiple values using rbf_set

Posted by IramK on 17-May-2017 17:55

Hello,

Prior to V4.5, we were able to use the rbf_setFieldValue or rbf_updateRecord() functions to actually set the field value to have multiple records by separating them with a pipe or comma.

For Eg: rbf_setFieldValue("testContacts", "1234|4444");

For some reason, this doesn't work in V4.5 and it errors and displays:

"Unable to fetch record details for ID: 1234|4444, Error: Error: Cannot retrieve Record Id's from request."

Any reason why this isn't working anymore? Tested this in the EAP too and it behaves in the same manner.

Seems like a new bug that has come up.

Cheers.

Iram

All Replies

Posted by mpiscoso@gmail.com on 18-May-2017 06:53

You may try to use an array and not a pipe separated string. ex. rbf_setFieldValue("testContacts", [1234,5678]);

Hope this helps.

Posted by IramK on 19-May-2017 06:21

Hi [mention:1dffaa150cb1489c912c9059c8804eef:e9ed411860ed4f2ba0265705b8793d05] ,

It works fine for setFieldValue but doesn't work the same way for rbf_updateRecord. Any suggestions on that one?

var testArr = [1234567, 455564];
var updatingArr = [];
updatingArr.testContacts = testArr;

rbf_updateRecord("obj", 213123213, updatingArr, true, function callback() { alert("done");});

Cheers.

Iram

Posted by mpiscoso@gmail.com on 19-May-2017 06:57

That is weird indeed [mention:19aa761d6eff491bb43da3a9faf25681:e9ed411860ed4f2ba0265705b8793d05]

I do not use rbf_updateRecord() that much to be able to give you a recommendation.

Although, I do use rbv_api.updateRecord() and with that API, to be able to save a Many relationship field I join the array.

For your example I would say do:

updatingArr.testContacts = testArr.join(',');

If the server-side API acts the same as the client-side one, that should probably work.

Hope that helps.

Posted by IramK on 19-May-2017 07:11

I think I have just found the fix.

updatingArr.testContacts = testArr.join('|'); // use pipes instead of commas. Commas used to work before but doesn't work anymore

Cheers.

Iram

Posted by mpiscoso@gmail.com on 19-May-2017 07:23

That is so weird. Why would progress have two different sets of inputs depending on the API for the same field type.

I believe this is actually a bug.

In reality I would have liked all of them to accept BOTH separators comma and pipe just so anyone can use the former or latter if they choose to. Either that or have just ONE standard input.

I'm pretty sure what we're discussing [mention:19aa761d6eff491bb43da3a9faf25681:e9ed411860ed4f2ba0265705b8793d05] isn't even in the docs.

I also believe that more examples are needed in the docs since people will eventually go down the path of more advanced coding especially for more complex requirements.

Good to know that you've found solutions on both fronts.

Good luck then.

This thread is closed