How to simulate 'is one of' filter operation in sele

Posted by ithrees on 17-Dec-2015 03:44

Hi All,

How the 'is one of ' filter operation can be simulated in a selectquery api as I have to write a query to get the students who is following an specific course among all the courses they are following?

The IN operator is not helping me or I am using it in a wrong way as below. (R121212 - student and course relationship, 2332323 - course id)

{SELECT student_Id FROM student WHERE  R121212 IN "2332323"}

Thanks in advance,
Ithrees 

All Replies

Posted by Shiva Duriseati on 17-Dec-2015 04:12

Hi Ithrees,

If your courseId is used as a lookup field then you can try using the following code.

var courseId=rbf_getFieldValue('2332323');

rbf_selectQuery("student_Id FROM student WHERE  R121212 IN ("+courseId+")",10,my_callback);

I hope the above solution works for you.

Please do let me in case you need any assistance.

Regards,

Shiva

Posted by ithrees on 20-Dec-2015 23:57

Thank you for you reply Shiva,

Since I am running this for a trigger to update a field, I tried the same and getting trigger timeout error even after I increase the trigger time.

Ithrees

Posted by ithrees on 21-Dec-2015 03:59

As I only need one related field value I am using the following,

var students_id = "";

var stds = rbv_api.getRelatedFields(" R121212", courseId, "student_Id");

for (var k=0; k<r.stds; k++) {

students_id = students_id+ ' , ' + stds[k];

}

students_id = students_id.substring(1);  //to remove the first comma character

Thank you and Regards,
Ithrees

This thread is closed