Front end extensions cant build

I have read the docs on how to create an extension module which I did by cloning defaultExt and renaming references. But now I want to compile it and watch for changes but none of the build or watch commands work.

Error: This command is not available when running the Angular CLI outside a workspace.

I cant understand how to do this correctly. I want to create an extension module for each core/base module and I am just struggling to get this part to work.

Try out:

Have u correct yarn version?

https://docs.suitecrm.com/8.x/developer/extensions/frontend/migration/migration-8.8/

I have run yarn build but every time I try run

yarn run build-dev:extension accountsExt

throw new TypeError(
                              ^
TypeError: The 'compilation' argument must be an instance of Compilation

I am struggling to get the build to run I cant see what I am missing from the docs.

I don’t think you’re supposed to change defaultExt, I think you should just be adding your changes under that directory.

Yes I finnaly understood it was a example and that I need to clone it for all teh new modules I want to create. I got it to work so now I am just working ont he rest.

is the custom php code supposed to be extended in teh backend folder in teh extensions as well?

The other dev has been doing everything in the legacy folder and I just want to follow best practices.

Hey man, could you by any chance show us how you added custom php code to a view ?

Hey @holdusback, I don’t think you can change the frontend/angular views by adding php code. Maximum php code could do is change the metadata/configuration that is sent to the frontend, and that configuration could change the way the views render.

There is an exception, the html fields. When loading the record you could probably can send custom html from the backend that is then rendered on the frontend on a field. However, that html would not be able to interact with angular, it would be for display only.

1 Like

Hey Anthony,
Thx for your answer !

I need PHP code to do :

  • Custom Verification on fields (matching custom regex etc) and then stopping the saving process and display a new error (having a hard time on this atm)
  • Override view (hide any tabs based on a field value for example, lock certain field based on user role etc)
  • Having the abilities to add a js file per module.

I made all of this in suite 7 but I fail in V8.

For now my verification.php is fired thanks to my before_save hook but I fail at stopping the save process when my condition is not matched.

Hey @holdusback,

On the above:

  • Backend code validations: I’ve not seen anything regarding this.
  • Frontend code validations: At the moment this should be possible by extending the frontend (with angular)

Only with front-end extensions.

Hey @rossrawlins how were you able to solve the error “This command is not available when runing the Angular ClI outside a workspace”?

used the angular CLI to generate project extensions and then it worked no issues.