Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > how to open, if document generated, generated form?

Forum

Search UsersRules
how to open, if document generated, generated form?
#1
Active user
Points:: 0
Joined:: Mar 6, 2018

Hello!

I want to generate forms just once. I gave same document number to generated form when it is filling. So i can find if it has generated before during the filling operation. But i can not open generated form with openvalue() function, because filling procedure working at server.

How can i open generated during the filling procedure?

Profile
#2
Interested
Points:: 0
Joined:: Dec 4, 2017

Dear eyup yilmaz,

Could you please provide us with code samples of the task you intend to perform?


Best regards,
Vladimir Gurov

Profile
#3
Active user
Points:: 0
Joined:: Mar 6, 2018

Hello again!

I have prepared a simple generate program. Document2 generated from document1. When i generate form in document1, i want to see generated form if it is already generated, not the new form.

Profile
#4
Interested
Points:: 0
Joined:: Dec 4, 2017

Dear eyup yilmaz,

Could you please clarify what behavior you would like to implement in the sample?

Our assumption:

1. Select Document1 with Number=2.
2. Click Generate > Document2.
3. Post Document2 with Number=2.
Expected result: 1C:Drive successfully posts Document2 with Number=2.
4. Select Document1 with Number=2.
5. Click Generate > Document2.
Expected result: 1C:Drive finds out that Document2 with Number=2 already exists, notifies you about that, and does not populate the form for Document2.

Is this assumption correct?

Best regards,
Vladimir Gurov

Profile
#5
Active user
Points:: 0
Joined:: Mar 6, 2018

Yes it is working like this. But i want to see generated form after 5th step;

5. Click Generate > Document2.
Expected result: 1C:Drive finds out that Document2 with Number=2 and show this form.

Profile
#6
Interested
Points:: 0
Joined:: Dec 4, 2017

Dear eyup yilmaz,

An example of checking if the document the user tries to create already exists is available in the attached infobase.

Please notice that the correct approach to implement the scenario you want is to use the "generate something based on something by using a hyperlink within a form" functionality. An example of this functionality is available in 1C:Drive demo: take a look at sales invoice and tax invoice documents there.

In your scenario, we recommend you to add an attribute to Document2, store a reference to Document1 in the attribute, and search for values of this attribute. This is a more reliable search strategy in comparison with searching for a document by its number.

When searching for a document by its number, the user may encounter situations when these numbers differ in Document1 and Document2 (for instance, Document1 was deleted, but Document2 exists). As a result, in such situations the search for documents will work incorrectly.

Searching for documents by reference does not have this shortcoming.

Best regards,
Vladimir Gurov

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.