The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

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;

 
#2
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

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);

 
#3
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

There is no way without defining the form, right?

 
#4
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

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

 
#5
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

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

 
#6
People who like this: 0 Yes / 0 No
Active user
Rating: 4
Joined: Apr 18, 2012
Company:

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.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)