In SuiteCRM 7, I had a JavaScript customization for the Contacts module that added icons to the list view. Clicking on these icons would redirect to another page. Given that SuiteCRM 8 only supports Angular, I am seeking guidance on how to inject the JavaScript file from SuiteCRM 7 into version 8.
Specifically, I am looking for the exact locations within the SuiteCRM 8 project directory to create the necessary Angular service, Angular component, and the JavaScript file imported from SuiteCRM 7.
I appreciate any guidance on the file locations and structures and any additional steps needed for injecting the JavaScript file from SuiteCRM 7 into SuiteCRM 8.
Hi @anthony.oak.castro ,
yes or like adding a button to the actions menu . Iām looking for ways to inject existing JavaScript into SuiteCRM 8⦠Can you help me with this?
When working inside a front-end framework like Angular, āinjecting javascriptā is not the proper way to do things. If you have any existing front-end JS code you would need to adapt it the new framework (basically - rewrite it), not try to inject it.
I understand this can be considerable work but there are also significant advantages - instead of having flaky hacks you can have proper customizations and extensions.
@pgr Sure, Iād appreciate your guidance on creating custom views (it seems with version 8 is quite different than previous versions) and handling redirections within the contacts module. Could you provide some tips to get started? Thanks!
You have some developer documentation in the docs site, but itās not much.
Other than that, itās better if you place more specific questions, just asking about āredirectsā is too vague.
On SuiteCRM v8 I find that copying from solutions already present in core code is often the best way to learn. So maybe try to find a redirect like the one you need in core.
@pgr Thank you for your advice! Iāve managed to add a custom button to the bulk actions in the contact moduleās list view. Now, Iām looking to redirect to a custom UI when this button is clicked. Iāve checked the developer documentation on the docs site, but itās limited.
@pgr Yes. Iāve added a custom button configuration in public/legacy/modules/Contacts/metadata/listviewdefs.php . The button is set up to trigger a custom action, and the associated backend logic is handled in core/backend/Process/Service/RecordActions/CustomRecordAction.php.within the backend Symfony service (CustomRecordAction.php), Iāve incorporated code snippets from the existing merge-records functionality to adapt and extend its capabilities for the custom action triggered by the button. Now, Iām seeking guidance on defining a custom route and establishing the frontend.For now, I aim to create a simple custom UI . If you have any insights or recommendations regarding Symfony routing and best practices for integrating custom frontend components with SuiteCRM8, your expertise would be invaluable. Thank you for your continued support!
Ok. Iām still learning this and my knowledge of v8 is very patchy, but here goesā¦
So in your Symfony back-end service, you are returning a $responseData, where you define a value for a āhandlerā. This seems to be instructions for how the front-end is going to handle the response.
I see several options for it here:
see also the actions sub-directory there. So you have noop which does nothing (when the back-end actions are enough), changelog (?), export (when the action causes a download on the browser, like the PDF letters etc), and⦠redirect.
If you search the code for those particular redirects with grep -rn redirect core/backend/