Hi,
I have been trying to add a Custom Field Type in SuiteCRM 8, Below are the steps I have followed:
1- I have created a Custom Field Type Name as "Color Picker " in the legacy framework
2- On the Angular side I have added a new field component āColor Pickerā in the default extension
3- After that, I registered it in the extensions.module.ts with the field
but no change is taking place as a new field on the front end side, Also I have tried to extend the varchar field in the extension for the front end changes but no luck.
Can someone please help me in this regard?
@clemente.raposo any thoughts?
Hey Muhammad/Clemente,
Iām still trying to figure out how to add a custom field type to SuiteCRM 8. Iāve followed the steps of creating a new field component and registering it in the Angular extension, but itās not showing up on the front end.
Have you had any luck with this or any new idea about what I might be missing?
Thank you for your time and assistance.
Best regards,
Hi @muhammad.bilal and @cvillaronga
Iām having troubles triying to port SuiteCRM 7.x custom field types I developed in the past to SuiteCRM 8.x. Iām trying to find documentation and I cannot see anything specific to this topic, other than old blog example. I see that in step 2 you have to create a new component and register it, I have found some documentation on this but I think that an actualization for this post to SuiteCRM 8.x could be better.
My questions are:
- Where did you find the tips that pointed you to this (that you have to create an Angular extension and register it).
- Can you explain what did you did?
- Finally, have you solved it?
Could you please share this info?. I am a developer, and I cuold try to help you if you didnāt solved it. I need to be able to port my custom types in order to update our SuiteCRM 7.x instances, but this problem is blocking us to upgrade.
Thanks in advance for your help and best regards.
Okay there are multiple steps here:
- have you created your extension or are you using the defaultExt?
2)is your extension enabled (config.php ⦠enabled=>true)
Angular:
You have created your 3 files for the field (minimum, if you want different views for edit/view/list you will need 3 folders and 3 files each).
in your extension.module.ts you have something like this (along with the relevant imports etc):
fieldRegistry.register(ādefaultā, āmap-iframeā, āeditā, MapIframeEditFieldComponent);
(that one is for the edit view only)
your extensions compiles correctly via yarn AND installs correctly into public/extensions/ and there are no errors when compiling OR loading your suite 8 instance (browser dev tools).
Lastly when setting up your field in your module:
the field definition (PHP) has the type: map-iframe (same as the angular register section ) AND a DBtype set (ie for a colour picker you will want type = ācolor-pickerā and dbtype = āvarcharā
Beware compiling in dev mode, the dev setup has the compile path to the public/extensions folder I found this less than optimal due to the bin/console cache:clear action, if you run a yarn build-dev:project with the compile path to public/extensions then a cache:clear deletes the folder with no backup install of your newly compiled extension (ie do a cache:clear FIRST then a compile and you are fine). Also note keep your browser Dev tools open and on the network tab disable cache to ensure each reload always loads the new Javascript.
Regards
Mark
Thanks @markbond .
No, I did only done legacy steps to view that it not longer works (I have experience and I have added a lot of custom types on 7.x versions, adding needed templates, etc). And that is was I was asking for. Where to find the info talking about what I need to do. For example before come here to this post I didnāt know that I have to make an Angular Extension to get it working. And this is why I am asking for. I donāt what a full explanation, but need someone that points me out to the correct way, and if you can get links to that info, I can walk into the way.
Reading your answer, Iām seeing that I need a lot more steps to get it working.
I have an updated 8.8.0 development version ready to try it. But I think that the problem is that we need more documentation, articles talking about this, in order to learn how to do it.
Thanks for your help!, but I think I need more to learn on this although your answer have relevant info that I have to search for.
@cautbur
I have had the opportunity to work on SuiteCRM 8 with a client, after an initial build out by SaleAgility I had gone in thinking it was Suite7 and it turned out to be Suite8, they (SA) had added their own extension to Suite8 for various customisations which included fields/processes etc, after about 15 months of development on Suite8 I have extensive experience developing a large number of features (including custom fields, sidebars, processes, actions etc) for suite8 (hope that answers where I learnt it - basically by example from SA).
So for increasing numbers of things you can do purely PHP (processes, injections etc). However for a large number of (frontend) things you do need an Angular extension, I had thought custom fields were on the suite 8 docs (I referenced that quite a bit) OR on the blog (Developer Insights Archives - SuiteCRM) but obviously not.
I would recommend reading everything here: Front-end :: SuiteCRM Documentation first paying particular attention to all the angular examples.
Then look at the folder: core/app/core/src/lib/fields for the core field types (and some logic stuff so ignore the field-logic and field-logic-display for now).
Then you need to understand that everything frontend needs registering in the extension.module.ts file before it can be used in Suite, also everything needs compiling and the compiled code either needs to compile directly to the public/extensions folder OR as per the instructions on the dev docs for dev environments.
IF I get a chance Iāll see if i can put together a tutorial on custom field types, i am quite busy so not sure when that will be however.
Regards
Mark
Thanks a lot @markbond!
I will check in deep all the info provided, and I will try to learn from it. If Iāll get it working, I will try also to make a tutorial, if you did not do it before.
Best regards!.