[V4.5 and beta V5.0] - Setting multiple values using rbf_setFieldValue() or rbf_updateRecord() - Forum - Rollbase - Progress Community

[V4.5 and beta V5.0] - Setting multiple values using rbf_setFieldValue() or rbf_updateRecord()

 Forum

[V4.5 and beta V5.0] - Setting multiple values using rbf_setFieldValue() or rbf_updateRecord()

This question is not answered

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
  • You may try to use an array and not a pipe separated string. ex. rbf_setFieldValue("testContacts", [1234,5678]);

    Hope this helps.

  • Hi ,

    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

  • That is weird indeed

    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.

  • 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

  • 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 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.