This is a migrated thread and some comments may be shown as answers.

[Solved] One appointment for each day

2 Answers 87 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Filiz
Top achievements
Rank 1
Filiz asked on 19 Jun 2009, 06:55 AM
I want to add just one appointment for each day. Time is not important, I want to add daily one record. Is this possible ? What can I do for this ?


Thanks

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Jun 2009, 11:26 AM
Hi Filiz,

I tried the following client side code in order to check whether any appointment is inserted for the day and cancel in new insert event if there is any already inserted.

JavaScript:
 
<script type="text/javascript"
function OnClientAppointmentInserting(sender, args) 
    var num = sender.get_appointments().get_count(); 
    forvar i = 0; i<num; i++) 
    { 
        var tempDate = sender.get_appointments().getAppointment(i).get_start().localeFormat('MM/dd/yyyy'); 
        if(tempDate == args.get_startTime().localeFormat('MM/dd/yyyy')) 
        { 
            alert("Only one appointment per day is allowed!"); 
            args.set_cancel(true); 
            return
        }  
    } 
</script> 

Shinu
0
Filiz
Top achievements
Rank 1
answered on 19 Jun 2009, 11:39 AM
Perfect !

Thank you Shinu
Tags
Scheduler
Asked by
Filiz
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Filiz
Top achievements
Rank 1
Share this question
or