Responding to changes in a list

Is there a way to respond to a change in a list on a freedom UI page in the code? Specifically I am looking to execute code whenever a new object is added to the list or whenever an object is deleted, but I can't seem to find what request handler I would need to use for it, if it exists at all.

 

Thanks in advance for any help

Like 0

Like

4 comments
Best reply

Hello,
 

I'm not sure if this is exactly what you're looking for, but
you can try the following handlers as an example to achieve your task:
1) When you delete on or more records from the list:

{
               request: "crt.DeleteRecordsRequest",
               handler: async (request, next) => {
                alert("delete triggered");
                   return next?.handle(request);
               }
           }

2) When you click on add button

            {
                request: "crt.CreateRecordRequest",
                handler: async (request, next) => {
                    alert("create triggered");
                    return next?.handle(request);
                }
            }

3) If you save on or more record with inline editing option in a list

            {
               request: "crt.SaveRecordsRequest",
               handler: async (request, next) => {
                   alert("save triggered");
                   return next?.handle(request);
               }
           }

Hello,
 

I'm not sure if this is exactly what you're looking for, but
you can try the following handlers as an example to achieve your task:
1) When you delete on or more records from the list:

{
               request: "crt.DeleteRecordsRequest",
               handler: async (request, next) => {
                alert("delete triggered");
                   return next?.handle(request);
               }
           }

2) When you click on add button

            {
                request: "crt.CreateRecordRequest",
                handler: async (request, next) => {
                    alert("create triggered");
                    return next?.handle(request);
                }
            }

3) If you save on or more record with inline editing option in a list

            {
               request: "crt.SaveRecordsRequest",
               handler: async (request, next) => {
                   alert("save triggered");
                   return next?.handle(request);
               }
           }

Serhii Parfentiev,

 

This looks like it may be what I was looking for.

 

To clarify the create record request, this triggers when the add button is clicked only, and not when the new record is added as well?

 

Thank you for letting me know about these handlers!

Alexander,

 

CreateRecordRequest is triggered once the "Add" button is clicked. You can also check it by adding local overrides in the browser in the needed list handlers.

Oleg Drobina,

 

Okay, thank you for the information.

Show all comments