How to simulate 'is one of' filter operation in selectquery? - Forum - Rollbase - Progress Community

How to simulate 'is one of' filter operation in selectquery?

 Forum

How to simulate 'is one of' filter operation in selectquery?

This question is not answered

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

  • 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

  • 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