Dear eyup yilmaz,
Could you please clarify what behavior you would like to implement in the sample?
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?