Custom module files

I have created SpiceCRM custom module using application locally and it created successfully, but I couldn’t see any related files generated into my code base, how to get those newly created custom module files into my code base?

@sitpu06 How did you create you custom module?
Using the dictionary manager?

yes @maretval , using custom modules tab and dictionary manager

@sitpu06 Well then, you won’t see any files in your code base. There is no file created when using the dictionary manager.

so, @maretval, if I need to modify any codes into newly created module, how to edit those file? (UI)
for example, I created custom module called forms, here I have to embed third party library into SpiceCRM to create form and need to save those submitted form values into my SpiceCRM contacts modules

To customize the backend php class:
Create a module class under
api/custom/modules/[yourmodulename]/[yourclassname].php
Example api/custom/modules/Forms/Form.php

Add your custom methods there.

If you add an external library:
Create an api/custom/vendor or add it in api/custom/include

hi @maretval , I need two new custom modules with relationship between each and I need to do UI modification on both component, for that I need to get those components files generated on my local editor while creating the component, to achieve this, how to create a module?

That can take a while to explain.
A relationship between modules is a backend defnition.
Can be done with the dictionary manager.

for your frontend components
src/custom/ will be the location.
Check the file architecture in the core files. It will be the same.
You will have to add your compnents in the object repository (workbench)

To run your application while developing, you will need:

  • a file called dev_server.url at the root of your CRM installation. Enter the url to call. Something like http://localhost/myspicecrm
  • install NodeJS and do npm install
  • then do npm start => application is compiled.
  • You can then open it under port 3333 http://localhost:3333

hi, @maretval , I have created custom module using Dictionary Manager and repair database, those table and field are created on my local spicecrm database, what should I do to get my custom module related files generated in my code base?, because I need to add form to my custom module and need to submit those form value and saved it into my DB, for this I need modules related files.
when I worked with SuiteCRM, after I created custom modules and repair and rebuild automatically I got that module related files under custom folder, but in SpiceCRM I dint find anything like this

@sitpu06 The whole point of the dictionary manager is not to have files. To create relationships: go to the dictionary manager.
If it is a one-to-many relationship: “one” record in module A can have multiple records in module B. Meaning that you will have a field to store to the ID of a module A record in a Module B record.

  • Create the id field in the dictionary of module B. Example module_a_id using domain guid. SAVE, repair database, repair cache + reset&reload
  • Then go to the dictionary of module A => Tab relationships.
    Add a relationship of type 1 to many
    Select Module B
    In the next step you will see module A on the left hand side and module B on right hand side.
    select module_a_id to match the id field in module A.
    Modifify the link names if necessary.
    Add labels so that links a labeled in the KReporter
  • SAVE
  • repair cache, then reset&reload

hi @maretval , Thank you for your relationship explanation,
what should I do to create custom module called A in spiceCRM and get those related file into my code base?
where should I create custom module and is there any way to repair and rebuild like suiteCRM to get those related file?

To create a custom module manually without the dictionary manager:
custom/modules/[yourModuleName]/vardefs.php
A dictionary Manager entry with the class name as dictionary name is necessary but you can define all the variable in the vardefs,php

Hi @maretval , my basic requirement is to create custom module with form page and submit that form values and save into our SpiceCRM DB, I need files to add my custom form into modules,
to achieve this do I need to create module manually?, cant I create module from SpiceCRM site?

To save into the SpiceCRM DB from an external website you need to use the SpiceCRM REST API.
Since the data shall then be available in the CRM, I guess yes. you will need some custom module(s).
But No, you cannot create a custom module using a form page. I still do not understand what you mean by form page (= external website?).