How do you extend the create.js on a module level?

We have created a 1 to 1 relationship for 2 custom modules. Now when we create a related record based on the parent record we want to hide or do some customization on the create drawer. We have already achieved this but we have to copy the entire create.js file to custom/client/base/view/create/create.js. My question is can this be done on a modular level without the need to copy the entire file?
Parents
  • Hi EvilPeri,

    To answer your primary question, the method you described for customizing the create.js file is currently the only supported method. In researching your question with our engineering team, the suggestion came up to potentially handle this use case in another manner. 

    Here is an example that extends the Record view (which the Create view also extends) and appends some content to it without having to copy and paste the controller or the template.  You still have to copy and paste the metadata from my understanding.

    You can create your own view that extends the Create view and then replace the normal Create view with your custom Create view in only the module layouts that apply for this scenario. Unless you really need to override the view and not just add something to the Create view, our advice is to build an additional view and add it to the Create layouts where needed.

    Chris
Reply
  • Hi EvilPeri,

    To answer your primary question, the method you described for customizing the create.js file is currently the only supported method. In researching your question with our engineering team, the suggestion came up to potentially handle this use case in another manner. 

    Here is an example that extends the Record view (which the Create view also extends) and appends some content to it without having to copy and paste the controller or the template.  You still have to copy and paste the metadata from my understanding.

    You can create your own view that extends the Create view and then replace the normal Create view with your custom Create view in only the module layouts that apply for this scenario. Unless you really need to override the view and not just add something to the Create view, our advice is to build an additional view and add it to the Create layouts where needed.

    Chris
Children
No Data