
In classic pages in Creatio, if you wanted to add code to the page’s save event, you simply had to add a save function to override the base page save function, do your work, then use this.callParent(arguments) to call the base page save function (so it actually saves the page). In Freedom UI pages, if you want to do this, you’ll need to add a handler for the page’s save request, which is called crt.SaveRecordRequest. This article will take a look at how this is done.
In the page where you want to do something in the save event, locate the handlers section, then add the following code:
{ request: "crt.SaveRecordRequest", handler: async (request, next) => { // Add any code to execute *before* the save here // This is useful to set values before the save so it saves with the record // Wait for the base page to execute it's handler to save the page const saveResult = await next.handle(request); // Add any code here to execute *after* the save has happened here // now return the saveResult return saveResult; } }
It’s most typical that you’re wanting to do things *before* the save happens (so you can save values with the record). In that case, the above can be simplified to the following:
{ request: "crt.SaveRecordRequest", handler: async (request, next) => { // Add any code to execute *before* the save here return next.handle(request); } }
Subscribe To Our Newsletter
Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!
You have Successfully Subscribed!