For List Page on save all button pressed which handler request to use to run the code?

I am trying to use crt.SaveRecordRequest for list page but this is not working, Is there any other request we need to use in freedom UI to run a code on Save all pressed? 

 

Here is my code

 

handlers: [
 {
   request: "crt.SaveRecordRequest",
   handler: (request, next) => {
     console.log("handler triggered: ");
     return next.handle(request);
   }
 }
],

 

 

I am able to run this code successfully on record page for that and code works perfectly but same code doesn't work on list page. 

 

For testing I have tried running HandleViewModelAttributeChangeRequest on list page and it worked fine so just the above SaveRecordRequest is not working.

 

handlers: /**SCHEMA_HANDLERS*/[

       {

           request: "crt.HandleViewModelAttributeChangeRequest",

           handler: async (request, next) => {

               console.log("# Atribute updated :", request);  

               return next?.handle(request);

           }

       }

   ]/**SCHEMA_HANDLERS*/,

Like 0

Like

2 comments

Hello,

 

You are right to use crt.SaveRecordRequest, the only thing you need to add a check for the attribute name. Here is the screenshot from the debugger when clicking the "Save all" button:

Like

 

 {
                request: 'crt.SaveRecordsRequest',
                handler: async(request, next) => {
                  if (request.itemsAttributeName == "GridDetail_9ib3s20"
) {
                    console.log("I am triggered");
                  }
                  return next?.handle(request);
                }
            }

Thank you for the response. I see the difference now so for record page its 'crt.SaveRecordRequest' but for list page its with s 'crt.SaveRecordsRequest'

Show all comments