How to control ChoiceForm of Calender

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Hi

I need to control the choiceform of Calender.

Task is to disable dates in usual date choice form, according to algorithm.

Is there any example?

 
#2
People who like this:0Yes/0No
Active user
1C:Professional
Rating: 8
Joined: Jun 25, 2013
Company: 1C Company

Hi,

Use a field of the CalendarField type.

First, let's show a user what dates are prohibited to be chosen.
In the DateOnPeriodOutput handler:

Code
Procedure DateOnPeriodOutput(Item, PeriodAppearance)
  ArrayOfProhibitedDates = ProhibitedDates(); // this is your procedure where you prepare
                                              // a narray of prohibited dates     
  For each SelDate In PeriodAppearance.Dates Do
   If Not ArrayOfProhibitedDates.Find(SelDate.Date) = Undefind Then
    SelDate.BackColor = WebColors.Coral; //any color you like
   EndIf;
  EndDo;
EndProcedure


Once a user select a date, check whether the date is allowed to be chosen.

And one more important step:
Before you post the document, check the selected date again on server, because the is a way for user to pass all checks on the form.

1C Company support team
 
#3
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

I solved it Sergey, thanks.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.