Forum Post: Counting records in object based on relationship

  • Thread starter Thread starter mgill
  • Start date Start date
Status
Not open for further replies.
M

mgill

Guest
Hi, I have a building sites object (site) which I can add building plots (plot). Relationship is many plots to a single site. However, I shouldn't be able to add the same plot number to a site twice. Am testing some validation on the "add new" plot page which does a count of the plots in the database with the plot number entered and the site (site is a hidden relationship field on the page). Plot no is character field. Integration name for the relationship field on plot for the site is R110925246. testing this on the pagesubmit event: alert(document.getElementById('plot_no').value); alert(document.getElementById('R110925246').value); var count = rbv_api.selectNumber("SELECT COUNT(1) FROM plot WHERE plot_no = '?' AND R110925246 = ? ", document.getElementById('plot_no').value, document.getElementById('R110925246').value); alert(count); First two alerts come back with a value, but the count does not show an alert. What am I doing wrong?

Continue reading...
 
Status
Not open for further replies.
Back
Top