Delete Request Handler

Hi Community,

I tried to delete a record in the list page with menu option based on below Code. But I got the  Error shown in the image

{
                            "type": 'crt.MenuItem',
                            "caption": 'DataGrid.RowToolbar.Delete',
                            "icon": 'delete-row-action',
                            "clicked": {
                                "request": 'crt.DeleteRecordRequest',
                                "params": {
                                    "itemsAttributeName": "Items",
                                    "recordId": "$Items.PDS_Id",
                                },
                                "useRelativeContext": true
                            }
                        },

Like 0

Like

3 comments

Hello,

Not sure what you are trying to accomplish.

Are you trying to create your own delete button based on the menu item? Then you can try doing it with a "Run Process" option or use the base menu item for the record.

Or are you receiving this error while using the base "Delete" option? In that case, make sure that you don't have connected records for this object (for example detail) because currently there is a problem with the base logic and it won't allow you to delete records with connected objects until version 8.1.

This error is still present in the 8.2 version. Do we have a fix for this? I am trying to call the crt.DeleteRecordRequest when a button is clicked!

 

 

Geeviniy Vazavan and Rakshith Dheer Reddy,

 

Why don't you try using the crt.DeleteRecordReques to achieve your task? Here:

 

{
                "request": "crt.DeleteRecordRequest",
                "handler": async (request, next) => {
                    var recordId = request.recordId;

                    //your logic here
                    await next?.handle(request);
                }
            }

 

This handler should be added to your list page schema handlers. Why this is not an option? What exactly is needed in the overriden action in the list that cannot be achieved with the delete handler override that will not return any errors?

Show all comments