Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > How to control ChoiceForm of Calender

Forum

Search UsersRules
How to control ChoiceForm of Calender
#1
Interested
Points:: 0
Joined:: Apr 5, 2012

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?

Profile
#2
Active user
Points:: 0
Joined:: Jun 25, 2013

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.

Profile
#3
Interested
Points:: 0
Joined:: Apr 5, 2012

I solved it Sergey, thanks.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.