how to open, if document generated, generated form?



The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Mar 6, 2018
Company:

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?

 
#2
People who like this:0Yes/0No
Administrator
Rating: 22
Joined: Dec 4, 2017
Company:

Dear eyup yilmaz,

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


Best regards,
Vladimir Gurov

1C Company support team
 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Mar 6, 2018
Company:

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.

Download 1Cv8.dt (32.87 KB)
 
#4
People who like this:0Yes/0No
Administrator
Rating: 22
Joined: Dec 4, 2017
Company:

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

1C Company support team
 
#5
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Mar 6, 2018
Company:

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.

Edited: eyup yilmaz - Sep 20, 2018 12:46 AM
 
#6
People who like this:0Yes/0No
Administrator
Rating: 22
Joined: Dec 4, 2017
Company:

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

1C Company support team
 
Subscribe