Scope: a managed application, a mobile application.
Best practices
When you develop commands directly in dynamic list forms, make sure their logic enables users to group a dynamic list by one of its columns. If a command logic fails to support processing of selected lines in a grouping, they need to be skipped. We recommend that you display a message if only one grouping line is selected in the list:
&AtClient
Procedure CommandInForm(Command)
ObjectsArray = Elements.List.SelectedLines;
If ObjectsArray.Count() = 1
AND TypeOf(ObjectsArray [0]) <> <ExpectedType> Then
Warning(NStr("en = "The command cannot be executed for this object"));
Return;
EndIf;
For Each ObjectFromList From ObjectsArray Do
If TypeOf(ObjectFromList) <> <ExpectedType> Then
Continue;
EndIf;
// Line object processing.
// ...
EndDo;
EndProcedure