rbv_api.setFieldValue keep giving "undefined"

Posted by Rollbase User on 30-Aug-2013 09:39

I trying to use folowing formula: var y = rbv_api.setFieldValue("shipment", {!id}, 'test', 1213211) rbv_api.print(y); For some reason I'm keep getting "undefined"  Please clarify.

All Replies

Posted by Admin on 03-Sep-2013 09:54

Hello Roman,



rbv_api.setFieldValue() does not return anything, hence the debug log displaying 'undefined'. "Rollbase in Action" describes the 'Return' of rbv_api.setFieldValue() as 'none', but more specifically it is NULL. I've confirmed the following statement to be true:



if (rbv_api.setFieldValue() == null) return true;



If you'd like to view the value of the field, simply use rbv_api.getFieldValue(), which specifically returns the value of the field. On our official documentation Rollbase in Action, please refer to page 177 for rbv_api.getFieldValue and page 178 for rbv_api.setFieldValue.



Here is the contents of a 'Trigger Condition Formula' I created as an example, also note that the integration name for my object is shipment3 and not shipment:



var y = rbv_api.setFieldValue("shipment3", {!id}, 'test', 123);



rbv_api.print(y);



return rbv_api.getFieldValue("shipment3", {!id}, 'test');



As you can see, the code retu

This thread is closed