In Designer mode

There is another picking method available: you can pick multiple items at once.

The option to select multiple items is enabled by default in all list forms. But the option to pick the selected items is usually disabled.

To enable the option, let us use the MultipleChoice parameter of the dynamic list form extension. 

  1. In the GoodsReceipt document form, update the Pick command handler as shown in listing 26.4.

    Listing 26.4. Pick button click handler

    &AtClient
    Procedure Pick(Command)
     
        FormParameters = New Structure ("MultipleChoice", True);
        OpenForm("Catalog.MaterialsAndServices.ChoiceForm", FormParameters, Items.Materials); 
     
    EndProcedure
    In the multiple selection mode the form returns an array of items instead of a single item. So you have to iterate through the array in the ChoiceProcessing handler.
  2. Update the ChoiceProcessing event handler as shown in listing 26.5.

    Listing 26.5. ChoiceProcessing event handler for the Materials table

    &AtClient
    Procedure MaterialsChoiceProcessing(Item, SelectedValue, StandardProcessing)
     
        For Each SelectedItem In SelectedValue Do
            NewRow = Object.Materials.Add();
            NewRow.Material = SelectedItem;
        EndDo;
     
    EndProcedure
Next page: In 1C:Enterprise mode
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.