How to create a validation for unique fields validation from

Posted by Rollbase User on 21-May-2013 06:44

I have 2 Objects: 1. Attendance 2. Status // is the Grid Control for Attendance object Relationship: One Attendance to Many Training Status here is my condition: If Member have already attended the Training Program AND same status, it will display a message error something like "Member:{!member} have already attended the Training:{!training_program} with Status:{!training_status} since:{!Schedule}." My idea: create a SELECT query (rbv_api.selectQuery) something like: var query = rbv_api.selectQuery("SELECT Members FROM Status WHERE Members=? AND training_status = ? AND training_program = ?",1000,member,status,tp); rbv_api.printArr(query); //just to debug and display the array of records var count = rbv_api.selectNumber("SELECT Members FROM Status WHERE Members=? AND training_status = ? AND training_program = ?",member,status,tp); if (count>0){ return "Error Message"; } I coudn't make this code on the Attendance object but in Status object, I was able to made this code using the Trig

All Replies

Posted by Admin on 21-May-2013 22:44

by the way, the Training Program which is a Formula Field that will call the Training Lookup field from the Schedule object (One Training to Many Schedules) after selecting the schedule.



From the Status Object, i have Trainings (Formula Field) that calls the Training Program (formula field from Attendance Object).



I don't know for what i've done if it is right or does it make sense?

This thread is closed