Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Dialog form for item selection without creating the form

Forum

Search UsersRules
Dialog form for item selection without creating the form
#1
Interested
Points:: 15
Joined:: Oct 27, 2011

Is there any chance to show input dialog for a user with items of some type with filter applied o just some list?

Example:
I have Contrapartes catalog
I want to show some dialog to the user to select Contraparte item (like InputValue() )
I do not won't to create a CommonForm because it is just one element input field
I can not show all items of catalog because the selection  should be restricted to Contrapartes with attribute Company = true;

Profile
#2
Guest
Points::
Joined::

Hello, Alexey!

You can use filters when open a form, in such cases you can use a choice form:

Code
   FormParameters = New Structure;
   FormFilters = New Structure;
   FormFilters.Insert("Owner", Object.Ref);
   FormFilters.Insert("ForOriginalText", False);
   FormParameters.Insert("Filter", FormFilters);
   Picture = Undefined;

   OpenForm("Catalog.StoredFiles.ChoiceForm", FormParameters, ThisForm,,,, 
      New NotifyDescription("InsertImageTranslationEnd", ThisObject), 
      FormWindowOpeningMode.LockOwnerWindow);

Profile
#3
Interested
Points:: 15
Joined:: Oct 27, 2011

There is no way without defining the form, right?

Profile
#4
Guest
Points::
Joined::

Alexey, if the choice form is not defined, the default choice form will be used.

Profile
#5
Interested
Points:: 15
Joined:: Oct 27, 2011

Correct me if I am wrong. I have to use OpenForm with default form to use filter, but I can't use InputValue.

Profile
#6
Active user
Points:: 0
Joined:: Apr 18, 2012

You can use such code

Code
&AtServer
Procedure OnCreateAtServer(Cancel, StandardProcessing)
   FilterArray = New Array;
   FilterArray.Add(New ChoiceParameter("Filter.Company", True));
   Items.Attribute1.ChoiceParameters = New FixedArray(FilterArray);
EndProcedure


or use property "Choice parameters" in the configuration tree or in the form designer.

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.