Answer the question
In order to leave comments, you need to log in
Checking the correctness of the Bitrix24 date entry?
Good day!
There is a business process in Bitrix24, it has a "date" field. When choosing from the calendar, everything is fine, but if you drive in with your hands, let's say 07/31/20, then Bitrix puts down the date 07/31/0020. How can I check if this field is filled in correctly?
Thanks
Answer the question
In order to leave comments, you need to log in
The element of the universal list (which you add and show in the screenshot) is in fact an element of the infoblock.
In the boxed version of Bitrix24, you can subscribe to the OnBeforeIBlockElementAdd event of the iblock module and check the corresponding field there.
Before using events, I recommend reading the corresponding article in the Bitrix Framework course , and also remember that the event is called for all elements (i.e. you need to check that you are processing exactly the right list) and that instead of a symbolic code, a custom field ID may arrive.
There is, of course, an alternative option: make a business process that checks the date for adequacy (for example, the year must be at least 2000 and no more than 2100) and, in case of a difference, find the corresponding delta and add the same number of years to the current date.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question