Question

How to override this peace of code in javascript Schema?

Hi there, I have a small problem with overriding schema in JavaScript. I need to override method "getEmailTitle" this method in schema SectionActionsDashboard (EmailMessagePublisher package). Is it even possible to override it? If yes, provide me some steps how I can complete it. Thanks so much!!

Like 0

Like

2 comments
Best reply

Hello,

Yes, you can override it, and in order to do so need to create a "Replacing view model" in your development package.

As a parent object you need to select "SectionActionsDashboard" and click apply (it will automatically set Code and Title).

After that you just need to write your js code. In the end it should look like this:

 define("SectionActionsDashboard", [],
	function(resources) {
		return {
			attributes: {},
			messages: {},
			methods: {
				getEmailTitle: function() {
					/*
						YOUR LOGIC
					*/
				}
			},
			diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
		};
	}
);

 

Hello,

Yes, you can override it, and in order to do so need to create a "Replacing view model" in your development package.

As a parent object you need to select "SectionActionsDashboard" and click apply (it will automatically set Code and Title).

After that you just need to write your js code. In the end it should look like this:

 define("SectionActionsDashboard", [],
	function(resources) {
		return {
			attributes: {},
			messages: {},
			methods: {
				getEmailTitle: function() {
					/*
						YOUR LOGIC
					*/
				}
			},
			diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
		};
	}
);

 

Dmytro Vovchenko, thank you so much!! It really helped me!

Show all comments