# trying to create a simple module for customer form

**URL:** <https://www.dolibarr.org/forum/t/trying-to-create-a-simple-module-for-customer-form/17436>\
**Category:** Developing for Dolibarr\
**Created:** [March 14, 2019, 6:11pm UTC](https://www.dolibarr.org/forum/t/trying-to-create-a-simple-module-for-customer-form/17436 "2019-03-14T18:11:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rao0070](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@rao0070](https://www.dolibarr.org/forum/u/rao0070)\
**Post date:** [March 14, 2019, 6:11pm UTC](https://www.dolibarr.org/forum/t/trying-to-create-a-simple-module-for-customer-form/17436/1 "2019-03-14T18:11:27Z")

</div>

hi, im trying to create a simple form for customer to checkin while he visits the store.  
trying to see if i can build a module which displays basic form data for customer to fill in  
like  
1)customer name  
2)address  
3)email  
4)phone  
5)referall details etc?

can someone help me understand where to start to create a module (form) to collect the details and how to make the data available for later ERP actions like creating a ticket / orders for the same customer.?  
any quick help would be much appreciated or advice details on where / how to start this .

> Pièces jointes :
> 
> - [Capture.jpg](https://www.dolibarr.org/forum/uploads/short-url/9HrlNNssnoo2a3L17F5StsVo7Cs.jpeg) (12.5 KB)

---

<div class="post-metadata">

**Author:** ![delcroip](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/a88e4f/32.png) [@delcroip](https://www.dolibarr.org/forum/u/delcroip)\
**Post date:** [March 28, 2019, 8:58pm UTC](https://www.dolibarr.org/forum/t/trying-to-create-a-simple-module-for-customer-form/17436/2 "2019-03-28T20:58:06Z")

</div>

hi,

for such simple usage check the module builder,

for more complexe module I’d rather build the pages from database [https://github.com/delcroip/dolibarr\_page\_from\_SQLtable](https://github.com/delcroip/dolibarr_page_from_SQLtable)  
and take only the folder structure from the module builder [https://github.com/Dolibarr/dolibarr/tree/develop/htdocs/modulebuilder/template](https://github.com/Dolibarr/dolibarr/tree/develop/htdocs/modulebuilder/template)

br

---

<div class="post-metadata">

**Author:** ![stkdm](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/2bfe46/32.png) [@stkdm](https://www.dolibarr.org/forum/u/stkdm)\
**Post date:** [April 2, 2019, 9:23am UTC](https://www.dolibarr.org/forum/t/trying-to-create-a-simple-module-for-customer-form/17436/3 "2019-04-02T09:23:46Z")

</div>

Hello delcroip,

I’m new in Dolibarr and I find your module very interessing.

What’s the best pratice to use it?

---

<div class="post-metadata">

**Author:** ![stkdm](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/2bfe46/32.png) [@stkdm](https://www.dolibarr.org/forum/u/stkdm)\
**Post date:** [April 2, 2019, 9:35am UTC](https://www.dolibarr.org/forum/t/trying-to-create-a-simple-module-for-customer-form/17436/4 "2019-04-02T09:35:19Z")

</div>

Hi delcroip,

I’d like to use your code, but I’m lost.

Where can I find the best way to use it?

Thank’s for your good job.

---

<div class="post-metadata">

**Author:** ![delcroip](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/d/a88e4f/32.png) [@delcroip](https://www.dolibarr.org/forum/u/delcroip)\
**Post date:** [April 7, 2019, 10:27am UTC](https://www.dolibarr.org/forum/t/trying-to-create-a-simple-module-for-customer-form/17436/5 "2019-04-07T10:27:12Z")

</div>

Hello,

First create the database table with any sql tool or simply by creating the sql file in the sql folder of the module and then activate the module it will run the sql file therefore create your new tables  
then copy the “create fromtable” in the dev folder of dolibarr and execute the php from command with the table name as param.

finally change the php file generated :  
- mymodule should be replace with your module name  
- remove the out. prefix  
- copy the files in your module folder (including the libs and ajax handler files)  
- correct the error fo the generqted file (it will have some

I still need to improve the script to create the test class and to create business/visualation classes to have a cleaner code but current output helped me a lot
