<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_create_a_Multi_Selector</id>
	<title>How to create a Multi Selector - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_create_a_Multi_Selector"/>
	<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_create_a_Multi_Selector&amp;action=history"/>
	<updated>2026-04-06T15:23:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.infinite-erp.co.id/index.php?title=How_to_create_a_Multi_Selector&amp;diff=265&amp;oldid=prev</id>
		<title>Wikiadmin: Created page with &quot;{{(!)| Contents in this document are available from '''3.0MP20'''}}  == Introduction ==  ''Multi Selector'' is a reference that allows to select multiple items at the same tim...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_create_a_Multi_Selector&amp;diff=265&amp;oldid=prev"/>
		<updated>2018-10-15T13:42:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{(!)| Contents in this document are available from &amp;#039;&amp;#039;&amp;#039;3.0MP20&amp;#039;&amp;#039;&amp;#039;}}  == Introduction ==  &amp;#039;&amp;#039;Multi Selector&amp;#039;&amp;#039; is a reference that allows to select multiple items at the same tim...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{(!)| Contents in this document are available from '''3.0MP20'''}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
''Multi Selector'' is a reference that allows to select multiple items at the same time. It is intended to be used as parameter of ''[[How_to_create_a_Standard_Process_Definition|Standard Process Definition]]''.&lt;br /&gt;
&lt;br /&gt;
Multi Selector reference is defined pretty much as regular selectors (which allow to select a single value). For more information about selectors take a look to this [[Selector_Example|example]].&lt;br /&gt;
&lt;br /&gt;
== Example Module ==&lt;br /&gt;
This howto is supported by an example module which shows examples of the code shown and discussed. &lt;br /&gt;
&lt;br /&gt;
The code of the example module can be downloaded from this mercurial repository: https://code.openbravo.com/erp/mods/org.openbravo.client.application.examples/&lt;br /&gt;
&lt;br /&gt;
The example module is available through the Central Repository (See 'Client Application Examples'), for more information see the [[Projects/ExamplesClientApplication|Examples Client Application]] project page.&lt;br /&gt;
&lt;br /&gt;
== Steps to implement the Process ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
&lt;br /&gt;
This howto explains how to create a Multi Order selector.&lt;br /&gt;
&lt;br /&gt;
[[Image:MultiSelector1.png|center|250px]]&lt;br /&gt;
[[Image:MultiSelector2.png|center|550px]]&lt;br /&gt;
&lt;br /&gt;
=== Defining the Selector ===&lt;br /&gt;
&lt;br /&gt;
* As ''System Administrator'' open ''Reference'' window.&lt;br /&gt;
* Create a new record.&lt;br /&gt;
** Name: Multi Order Selector&lt;br /&gt;
** Parent Reference: OBUISEL_Multi Selector Reference&lt;br /&gt;
* In ''Defined Selector'' tab, set the properties for the selector:&lt;br /&gt;
** Template: Selector Template&lt;br /&gt;
** Table: C_Order&lt;br /&gt;
&lt;br /&gt;
=== Adding fields to Selector's Pop Up ===&lt;br /&gt;
&lt;br /&gt;
Last step is to define which are the fields that will be present in the popup to select records.&lt;br /&gt;
&lt;br /&gt;
* Go to ''Defined Selector Field'' tab&lt;br /&gt;
* Create records:&lt;br /&gt;
** Name: it is the name the use will see (i.e. Business Partner)&lt;br /&gt;
** Property: actual property to retrieve information from (i.e. businessPartner)&lt;br /&gt;
** Sorting of columns in the grid: Position of this column in the grid (i.e. 20)&lt;br /&gt;
&lt;br /&gt;
[[Image:MultiSelectorAD1.png|center|650px]]&lt;br /&gt;
&lt;br /&gt;
=== Using the Selector ===&lt;br /&gt;
&lt;br /&gt;
This selector can be used as parameter for a Process Definition. In [[How_to_create_a_Standard_Process_Definition#Adding_Parameters|this howto]] it is used.&lt;br /&gt;
&lt;br /&gt;
=== Retrieving values in backend ===&lt;br /&gt;
&lt;br /&gt;
In backend, the Java implementing the process, receives an &amp;lt;code&amp;gt;JSONArray&amp;lt;/code&amp;gt; with the IDs of all selected rows. In case no row is selected, an empty array is received.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
      //...&lt;br /&gt;
      JSONArray orders = params.getJSONArray(&amp;quot;orders&amp;quot;); // get the array&lt;br /&gt;
     &lt;br /&gt;
 &lt;br /&gt;
      // iterate it&lt;br /&gt;
      for (int i = 0; i &amp;lt; orders.length(); i++) {&lt;br /&gt;
         // ...&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced topics ==&lt;br /&gt;
&lt;br /&gt;
=== Using custom query selector ===&lt;br /&gt;
&lt;br /&gt;
When using a [[Selector_Example|custom query to define the selector]], there must be an alias in the query named &amp;lt;code&amp;gt;_identifier&amp;lt;/code&amp;gt; which will be used as user readable identifier for the selected records and another one named &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; which will be sent to backend as id of the selected records. Fields for these query columns with the same names are also required.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
Multi Selectors can only be used as parameters in ''Standard Process Definition'', they cannot be included in ''Standard Windows''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
</feed>