While I am a developer by profession (albeit one who hasn’t really worked with PHP in years), however, even after reviewing available documentation (included the post pinned at the top of this forum), I am still not clear on best practices in regards to creating custom module.
Specifically, I planned on starting using the Module Builder to define entities, fields, relationships, etc. I would then like to use this as a “base” for adding functionality that requires some coding. However, I am not clear on what the next best step is. For example:
In Module Builder, should I “Export” the module, add whatever custom code is needed, zip it back up, and then loaded it via Module Loader?
Similar to above, but using “Publish” instead of Export?
Something else?
Additionally, what is the best approach for performing updates to the custom module? Should you disable the “old” version and then load the new one? Or will Suite properly update it with the new version.
Hello Fortran!
You do not need to export the module, if you plan to work on the very same SuiteCRM instance. The export option lets you pack the modules you drafted for exporting them to be distributed and installed to another SuiteCRM for further development - or as a backup if you want. The publish -function lets you publish for installing to another SuiteCRM instance, for example, your customer or for public to download.
SuiteCRM takes care of the compatibility. Your Module Builder -created modules will be compatible with future SuiteCRM versions.
The standard procedure is:
You create a package containing the modules you will want to have.
You create your modules one by one, define the fields and layouts as needed and then
Save → your changes are saved in Module Builder files
Deploy → your modules, fields and layouts will be updated
Quick Repair And Rebuild → Your fields will be updated to database structure
You can continue the development in Module builder to the point you think that all fields and layouts look good.
After the layouts you may want to customize search options etc in Studio. That lets you continue finetuning search fields etc. You can do more in Studio, but beware: changes done in Studio will be overwritten if you come back to edit same module in Module builder.
The functionality that requires coding can be added after these steps.
You may even end up adding more fields by manual variable definition files, and those can coexist with Studio created fields, but not edited in Studio.
Then you might consider using logic hooks to add more functions like changes to other fields according filled fields, or more complicated data handling trough SuiteCRM API.
We have a very powerful platform, which let you easily create custom modules by Module Buidler, finetune them with Studio or add more functionality with logic hooks, vardefs (variable definitions) and customized php coded + tons of more with API and your python/cobol/whatever/applications/you/want to further handle your customer data.