<?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_Modularize_The_Location_Selector</id>
	<title>How To Modularize The Location 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_Modularize_The_Location_Selector"/>
	<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_To_Modularize_The_Location_Selector&amp;action=history"/>
	<updated>2026-04-06T15:14:09Z</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_Modularize_The_Location_Selector&amp;diff=2806&amp;oldid=prev</id>
		<title>Wikiadmin: Created page with &quot;{{RatingArticle}} {{Languages | Documentation_Style_Guide}} == Objective == The objective of this article is to show you how to modify and modularize the '''Location Selector'...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_To_Modularize_The_Location_Selector&amp;diff=2806&amp;oldid=prev"/>
		<updated>2021-12-16T05:12:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{RatingArticle}} {{Languages | Documentation_Style_Guide}} == Objective == The objective of this article is to show you how to modify and modularize the &amp;#039;&amp;#039;&amp;#039;Location Selector&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{RatingArticle}}&lt;br /&gt;
{{Languages | Documentation_Style_Guide}}&lt;br /&gt;
== Objective ==&lt;br /&gt;
The objective of this article is to show you how to modify and modularize the '''Location Selector'''.&lt;br /&gt;
&lt;br /&gt;
== Recommended articles ==&lt;br /&gt;
Before reading this guide, it is necessary to have a proper understanding of Openbravo's [[Modularity]] concept and how to [[How_To_Create_and_Package_a_Module | create and package a module]],&amp;lt;br&amp;gt;as we take the knowledge from these articles as a given in this guide.&lt;br /&gt;
&lt;br /&gt;
In case you are working with configuration scripts or templates on a regular basis, the following link to an article might be of interest to you, since it describes [[How_To_Create_a_Configuration_Script | how to create a configuration script]].&lt;br /&gt;
&lt;br /&gt;
== Execution Steps ==&lt;br /&gt;
The steps needed to change and modularize the Location Selector are as follows:&lt;br /&gt;
&amp;lt;ol start = &amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Define your own '''Module''' and export it. The module folder will be then be generated, for example:&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
 modules/com.openbravo.support.locationexample/&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Create the source folder for the '''Module''' we just created previously. For our example it should look like this: &lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
 src/com/openbravo/support/locationexample/info/&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Copy the original files of the Location Selector into the newly created folder. When copying the files, maintain the original file names. The original files are located at: &lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
 src/org/openbravo/erpCommon/info/Location&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Modify the following files to make them part of your package: &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Location_Search_data.xsql''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Change the defined package to: &amp;quot;com.openbravo.support.locationexample.info&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Location.java''':             &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Change the package to: &amp;quot;com.openbravo.support.locationexample.info&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Change the following mappings to use the new mappings:&lt;br /&gt;
&lt;br /&gt;
org/openbravo/erpCommon/info/Location_FS -&amp;gt; com/openbravo/support/locationexample/info/Location_FS&lt;br /&gt;
org/openbravo/erpCommon/info/Location_F1 -&amp;gt; com/openbravo/support/locationexample/info/Location_F1&lt;br /&gt;
org/openbravo/erpCommon/info/Location_F2 -&amp;gt; com/openbravo/support/locationexample/info/Location_F2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
After that you can apply all the changes you want to do.&lt;br /&gt;
In our example we have just changed the labels for the fields.&lt;br /&gt;
&lt;br /&gt;
{{(!)|'''Note:''' There is a '''Trigger''' ''c_bpartner_location_trg'' that inserts the location name into the name field of the ''c_bpartner_location'' name after any changes. That name is created using the '''Function''' ''c_location_name''.&lt;br /&gt;
If you add new fields in the Location Selector and also want to use the information to compose the name, you will need to do the following:&lt;br /&gt;
&lt;br /&gt;
*Create your own '''Function''' based on ''c_location_name'' to compose the name that you want to save.&lt;br /&gt;
*Create your own '''Trigger''' based on ''c_bpartner_location_trg'' to use that new function to save the name.&lt;br /&gt;
*Deactivate the ''c_bpartner_location_trg'' '''Trigger''' and use your own one instead. &lt;br /&gt;
&lt;br /&gt;
To deactivate it, you have to delete it and then export the changes into a '''Template''' set ''In Development''. At the top of the configScript.xml template you will see that there is a line that indicates that the trigger was removed (''RemoveTriggerChange'').}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ol start = &amp;quot;5&amp;quot;&amp;gt;&amp;lt;li&amp;gt;&lt;br /&gt;
Create a new search reference for the new files for your module and your own name. Define that new reference to use your own Java Class and your own mappings:&lt;br /&gt;
 &lt;br /&gt;
||[[Image:LocationReference1.png|thumbnail|right|150px|View larger]]||||[[Image:LocationReference2.png|thumbnail|right|150px|View larger]]||&lt;br /&gt;
&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start = &amp;quot;6&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Define a new template module and mark it as ''In Development''. You can use the template we used to deactivate the Trigger:&lt;br /&gt;
&lt;br /&gt;
In the '''''Tables and Columns''''' window, find the column which you want to use with the Locator Selector we have created and change the '''''&amp;quot;Reference Searchkey&amp;quot;''''' combo to use this new reference.&lt;br /&gt;
In the example we have done it in the ''C_Bpartner_location'' table, in the ''c_location_Id'' column.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Compile the application with: &lt;br /&gt;
&amp;lt;pre&amp;gt;ant smartbuild&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
Restart tomcat and use the column to check that the new reference is working with the new changes.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-|- valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
Following screenshot shows the results of our changes:&lt;br /&gt;
 &lt;br /&gt;
||[[Image:LocationSelectorExample.png|thumbnail|right|150px|View larger]]||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
</feed>