Hi Community,

 

I have this business requirement, where I need to calculate my "Monthly Total" field right after I finish loading my form page.

 

These are the formula and fields I want to calculate:

 

var total = (monthlySubTotal - discountAmount) + ((monthlySubTotal - discountAmount) * (taxRate / 100));

 

 

I tried to use "crt.HandleViewModelInitRequest" handler, but it didn't work. Because, the data is not fully loaded.

 

Is there any other handler that I can use, that waits for all the data to be loaded and then calculate my formula?

 

Thanks in advance.

 

Best Regards,

Pedro Pinheiro

 

 

 

 

 

Like 1

Like

4 comments
Best reply

 Hello. Try this.

{
	request: "crt.HandleViewModelAttributeChangeRequest",
	handler: async (request, next) => {
		if (request.attributeName === "UsrFirstField" || request.attributeName === "UsrSecondField") {
			//recalc
		}
		return next?.handle(request);
	}
}

 

 Hello. Try this.

{
	request: "crt.HandleViewModelAttributeChangeRequest",
	handler: async (request, next) => {
		if (request.attributeName === "UsrFirstField" || request.attributeName === "UsrSecondField") {
			//recalc
		}
		return next?.handle(request);
	}
}

 

Alex Zaslavsky,

 

Thank you for  the reply.

 

I'm using the "crt.HandleViewModelAttributeChangeRequest" handler when a field is being changed.



However, in this situation, the field does not receive any change. For example, the "Tax Rate, %" field has 15.00 as its default value. This does not trigger the "crt.HandleViewModelAttributeChangeRequest" handler. But I need it to calculate the "Monthly Total" field.



After some research, I found the "crt.LoadDataRequest" handler. This handler is executed after all the data has been loaded. So, for the moment, it's working for our requirement.

 

Best Regards,

Pedro Pinheiro

I think your "Tax Rate" field triggers this request, but it's silent.

request.silent

 

Alex Zaslavsky,

 

I've changed the solution and now it's working with the "crt.HandleViewModelAttributeChangeRequest" handler.

 

Thank you.

 

Best Regards,

Pedro Pinheiro

Show all comments

Hi all,



I have multiple edit pages for a section in classic UI and I want to upgrade my instance to freedom UI. How can I set up several form pages in Freedom UI for a section?







Thanks in advance & regards

Goparna Nasina

Like 4

Like

5 comments
Best reply

Goparna Nasina,

This is now possible in Creatio 8.1.

Ryan

Not yet possible in Freedom UI.

Hi community,



Any update on the multiple edit pages in Freedom UI?

Currently we have 3 edit pages for opportunity in our classic UI instance and we wanted to convert the opportunity page to freedom UI page.

Kindly let us know how this can be done.



Thanks in advance

Goparna Nasina

Goparna Nasina,

This is now possible in Creatio 8.1.

Ryan

Ryan Farley,

Thanks Ryan

Ryan Farley,

 

I've a freedom UI section with three edit page, which depends on a lookup field.

Is it possible to control which user can use a specific edit page?

In the classic UI using record permission on lookup values and  a bit of javascript code I can hide the edit pages based on the current user.

Thank you

Show all comments