Question

How to modify/override mixins

Dear Community,

 

I need to override a function in 'CaseServiceUtility' mixin. I am getting "Substitution not allowed error". I followed this guide I found in community

https://customerfx.com/article/overriding-modules-in-creatio-formerly-b…

 

Here also, I am getting error that my new module is needed by BootstrapmodulesV2 and it is not found

 

Please advise how to proceed. Is there any other way of doing this.

Like 0

Like

4 comments

Hi,

 

1) Create a module in configurations called UsrCaseServiceUtility (or with the name suitable for you)

2) Specify the code inside this mixin

3) Create a replacing view module for the CasePage module

4) Add the newly created mixin in the dependencies for this replaced module:

 define("CasePage", ["UsrCaseServiceUtility"],
		function() {
			return {
				entitySchemaName: "Case",

5) Specify that the added module is a mixin:

modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
				dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
				mixins: {
					CaseServiceUtility: Terrasoft.UsrCaseServiceUtility
				},

6) Save the changes and refresh the page

 

Best regards,

Oscar

Oscar Dylan,

 

Thanks for Reply Oscar. The problem here is The method I need to modify 'prepareCaseTermCalculatorConditions' is not being called from the casepage. It is being called from the mixin itself under 'recalculateServiceTerms' method of 'CaseServiceUtility' mixin. 'recalculateServiceTerms' method is called when service is changed.

 

If I create a new mixin then I cannot be able to change the flow If I add it to case page. If I can add it to 'CaseServiceUtility' mixin then also I have to modify it in my current package.

 

Is there any other way?

Nagaraju,

 

You can create your own method based on the existing one in your custom mixin and modify the start conditions on the CasePage or in the custom mixin if needed.

 

Best regards,

Oscar

Oscar Dylan,

 

Thanks for reply. Here, I have to modify all the methods that start this method from casepage. But, In this case the method is being triggered when Attribute changes like onServiceChanged, On StatusChanged.

 

I think we can not disable these attribute calls that are defined in lower packages. If we can please share how.

Show all comments