How Disable option to delete & copy records in a Section in Freedom UI

Dear colleagues,

 

In Classic UI I can solve this by code, but in Freedom is also possible?, somebody know in which schema I need to do this and the related code?

 

Thanks & Regards

Like 0

Like

8 comments
Best reply

Hello Julio,

See this article here: https://customerfx.com/article/adding-row-action-menu-items-to-a-creati…

You can override the menu (usually to add other menu items to it). When you do so you override the "Open", "Copy", "Delete" options and need to add them back in. You could override the menu and then just only add back in the "Open" option. It would look like this (the article will provide more details)

viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
    {
        "operation": "merge",
        "name": "DataTable",
        "values": {
            //...,
            "rowToolbarItems": [{
                type: 'crt.MenuItem',
                caption: 'DataGrid.RowToolbar.Open',
                icon: 'edit-row-action',
                disabled: "$Items.PrimaryModelMode | crt.IsEqual : 'create'",
                clicked: {
                    request: 'crt.UpdateRecordRequest',
                    params: {
                        "itemsAttributeName": "Items",
                        "recordId": "$Items.PDS_Id"
                    }
                }
            }]
        }
        //...
    },
    //...
]/**SCHEMA_VIEW_CONFIG_DIFF*/

Essentially you're replacing the existing menu with one that only has the Open menu option. This works for any list (section or a list on a page)

Ryan

and the same in a Detail (Freedom page)?

Hello Julio,

See this article here: https://customerfx.com/article/adding-row-action-menu-items-to-a-creati…

You can override the menu (usually to add other menu items to it). When you do so you override the "Open", "Copy", "Delete" options and need to add them back in. You could override the menu and then just only add back in the "Open" option. It would look like this (the article will provide more details)

viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
    {
        "operation": "merge",
        "name": "DataTable",
        "values": {
            //...,
            "rowToolbarItems": [{
                type: 'crt.MenuItem',
                caption: 'DataGrid.RowToolbar.Open',
                icon: 'edit-row-action',
                disabled: "$Items.PrimaryModelMode | crt.IsEqual : 'create'",
                clicked: {
                    request: 'crt.UpdateRecordRequest',
                    params: {
                        "itemsAttributeName": "Items",
                        "recordId": "$Items.PDS_Id"
                    }
                }
            }]
        }
        //...
    },
    //...
]/**SCHEMA_VIEW_CONFIG_DIFF*/

Essentially you're replacing the existing menu with one that only has the Open menu option. This works for any list (section or a list on a page)

Ryan

Ryan Farley,

Thanks Ryan, I promise I looked first, before to publish, in your articles, but didn't found this one. Thanks a lot

 

Regards

Julio

Ryan Farley,

Dear Ryan, I didn't found the crt.DataGrid element in the viewConfigDiff in the code of the listpage, I found it on a FormPage, but I need it also in a the ListPage

solved no need to search crt.DataGrid, jus add it on viewConfigDiff

Julio.Falcon_Nodos,

Yes correct. For the list page, the List (crt.DataGrid) exists in the parent page, you just need to merge in the changes.

Ryan

No worries - there's so much new info now with Freedom UI stuff, it's hard to know what to even search for!

Julio.Falcon_Nodos writes:

Ryan Farley,

Thanks Ryan, I promise I looked first, before to publish, in your articles, but didn't found this one. Thanks a lot

Regards

Julio

This could really do with being configurable using no-code tools, as it's quite cumbersome to apply to every list users will see but is often important - being able to copy records which should have to be created in specific ways is often an issue for business data.

Show all comments