• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

Notes Web

I have an appointment system which users can enter an appointment via the web.  I want to be able to limit the appointments to 7 appointments in the morning and 7 in the afternoon.  If a user tries to enter an appointment for an afternoon where there is already more than 7 appointments or if there is already an appointment at that time, I want to display a message to the user to select another time or date.  What is the best way to do this?
0
fayeb
Asked:
fayeb
  • 5
  • 4
1 Solution
 
AndrewJayPollackCommented:
code in the webquerysave() should lookup to a view that lists the appointments, then just process through, make a descision and return to the submitted appointment or a success document.
0
 
fayebAuthor Commented:
What do should I use to code this?
0
 
AndrewJayPollackCommented:
lotus designer, using lotuscript.  If this isn't something you've done before, several of us are capable of doing it, but most would charge you as a consultant to do so.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
fayebAuthor Commented:
I can do the lookup I just need to know how I would send the message back to user if there is a problem
0
 
AndrewJayPollackCommented:
ah.

well, there are a few ways to do it.

easiest:

Print " Dear user, <br>"
print " The appointment you wanted is no good. <br>"
print " please use your back button to reselect."

Harder:

but a field on your form called "displayerror".
assume your webquerysave() uses teh variable "doc" for the notes document that was submitted:

doc.displayerror = "appt. not available"
call doc.save(false,false)
print "[/path/database.nsf/0/" & doc.universalid & "?editdocument]"

--------------
this one will write the error to the document the user submitted, the redirect the user to that document where the error will display (if you put the field on the form) and let the re-edit and submit.
0
 
fayebAuthor Commented:
Can this be done using javascript?
0
 
AndrewJayPollackCommented:
yes, but I don't speak javascript well.  it would be a webquerysave agent just the same, but in javascript.  Only the syntax would change.
0
 
fayebAuthor Commented:
I have been asked to show a solution in Javascript which is why I increased the points.  Can any one help with this?

Thanks
0
 
ZvonkoSystems architectCommented:
Hello fayeb,

this can not be done by JavaScript because JavaScript is browser client side. For JavaScript it is not possible to check anything on Domino side. All data have to be provided in advance to browse so that JavaScript can act on this data. But your question does not look as all appointment data are available in the browser.

So what do you like to do in JavaScript?

My proposal would be to let WebQuerySave agent do the lookup on Domino and abort the appointment saving. Additionally can your WQS agent set the value of a ErrorMessage field to be redisplayed on the web page. The only part for JavaScript would be to look for this field at onLoad event of the page and produce some popup alert. This is something I like to do to emphasize the alert message.

Is this something for you?

0
 
fayebAuthor Commented:
Zvonko,

This is exactly what I want to do.  I just needed to establish that this could/couldn't be done using javascript.  A webQuerySave agent will be fine.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now