How to loop through the records with condition

Posted by ithrees.ai on 28-Apr-2014 06:04

Hi Folks,

For the server side script implementation, how to do the looping for all the records that satisfy the conditions of an object in rollbase? 
Please make me clear on this.

Thanks in advance.

Ithrees

Posted by Sharavan Kumar on 28-Apr-2014 07:43

Hi ithrees

Here is sample example on how to do the looping for all the records that satisfy the conditions of an object in rollbase.

var arr = rbv_api.selectQuery("select firstName from ssapinew1_emp where lastName=?",10,lname); ---------- >this will return array of firstNames

var buff = "Name:"

for (var i=0; i<arr.length; i++) {            

buff += arr[i][0]+", ";

}

rbv_api.setFieldValue("ssapinew1_emp", "{!id}", "ssapinew1_selquery", buff);

Note : Although we have some tokens using which you can work on loops , however it is not suggestable.

You can refer to the documentation for more details.

documentation.progress.com/.../index.html

Hope you find this useful.

Thanks,

Sharavan

All Replies

Posted by Sharavan Kumar on 28-Apr-2014 07:43

Hi ithrees

Here is sample example on how to do the looping for all the records that satisfy the conditions of an object in rollbase.

var arr = rbv_api.selectQuery("select firstName from ssapinew1_emp where lastName=?",10,lname); ---------- >this will return array of firstNames

var buff = "Name:"

for (var i=0; i<arr.length; i++) {            

buff += arr[i][0]+", ";

}

rbv_api.setFieldValue("ssapinew1_emp", "{!id}", "ssapinew1_selquery", buff);

Note : Although we have some tokens using which you can work on loops , however it is not suggestable.

You can refer to the documentation for more details.

documentation.progress.com/.../index.html

Hope you find this useful.

Thanks,

Sharavan

This thread is closed