Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Selected data in documents code prefix

Forum

Search UsersRules
Selected data in documents code prefix
#1
Just came
Points:: 0
Joined:: Dec 2, 2019

Dear all,
I would like to know if there is any way to put month and day numbers in documents prefix.
For example, if selected date is 03.12.2019 then prefix should be DOC/0312/00001+(1). I want to know how to get DD(03) and MM(12) and put them in prefix.
Thanks for advance!

Profile
#2
Just came
Points:: 0
Joined:: Aug 5, 2016

Hello Jānis,
the easiest way to extract the part of the date is to use the platform's method Format like this

Code
Prefix = Format(YourVariableContainingTheDate,"DF=ddMM")

How to apply the extracted prefix to the number? - it depends on the solution you use.
In the abstract solution there should be document's event
Code
Procedure OnSetNewNumber(StandardProcessing, Prefix)

where you can pass your prefix

Profile
#3
Just came
Points:: 0
Joined:: Dec 2, 2019

Thanks, but how do I set date to variable, if date is selected by user?

Profile
#4
Active user
Points:: 0
Joined:: Mar 10, 2017

Dear Jānis,

It depends on where the user is selecting the date. But usually you just add the event handler to the date control on the form and assign the selected date to your variable like this

YourVariableContainingTheDate = YourSelectedDate;

Profile
#5
Just came
Points:: 0
Joined:: Dec 2, 2019

Thanks for big help Pawlo and Alex : )

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.