Problem with executing formula on hosted Cloud

Posted by Rollbase User on 01-Mar-2013 06:13

Hi, I'm still trying to understand why I was having issue described in https://getsatisfaction.com/rollbase/topics/trying_to_use_rbv_api_getrelatedfields_to_get_a_value_from_picklist I was just trying to run the same formula (Expression (String)) var ctr = rbv_api.getRelatedFields('R62528901', {!id}, 'contractor#code'); return ctr.join(', '); on two related object and it did work this time, but for some reason only some of the related values form pucklist were extracted and some values were missed. After some time I decided to reran the same code on the same field but this time no results was extracted at all (please note that nothing was changed in the objects from my side)! I'm suspecting that it have something to do with execution of the code by the Rollbase server, ether load is too high or some other reason. Still, I would like to have clarification from Rollbase team on that matter. Inconsistency of the data that I'm having because of misbehavior of the Rollbase database is unacceptable.

All Replies

Posted by Admin on 01-Mar-2013 11:27

Please verify that:

- related records are attached

- they have "contractor" field populated

Posted by Admin on 01-Mar-2013 23:15

Records are attached

"contractor" field is populated



It has something to do with a #code suffix for pick-lists

When I'm not using #code then I'm getting value ID



And when I'm inserting #code then no values being retrieved

Posted by Admin on 02-Mar-2013 11:41

It looks like you did not assign integration codes to your pick items. Please do it like this:



South|S

North|N

East|E



Please check Chapter 2 for more info.

Posted by Admin on 09-Mar-2013 07:16

My saga continues...

I'm still trying to import values from one related object to another using Expression so later on i can apply filters to those records.

I assign integration codes to pick items as it was suggested above and it worked.

But after latest Rollabse update I can't create new records. api.getRelatedFields is looking for non existing records in related object and when not finding such prohibiting me from creating new record giving me a system error.

Rollbase support suggested me to use "catch (e)" to overcome this problem. What ever I able to find on this forum I assembled into a new formula:



try { var lsp= rbv_api.getRelatedFields('R62551360', {!id}, 'lsp#code');

return lsp.join(", ");

} catch(e) { throw e.message + " " + field; }



Despite the fact that formula is working I'm still unable to create new records. I'm keep getting:

"System Error

Error "field" is not defined. (line #6) in formula: var rbv_api = new Packages.com.rb.core.services.api.ServerSideAPI(62353474, 62356555); fun

Posted by Admin on 09-Mar-2013 07:27

Just try this:



catch(e) { return ''; }

Posted by Admin on 09-Mar-2013 08:48

Thank you Pavel, your solution is working. I'm able to create new records again.



try { var lsp= rbv_api.getRelatedFields('R62551360', {!id}, 'lsp#code');

return lsp.join(", ");

} catch(e) { return ''; }

Posted by Admin on 10-Mar-2013 13:02

Great! Marking as resolved

This thread is closed