Question

Disabling ADD(+) button on a detail list

Hello,

How can a detail view list be made read-only on a page? We want the list to be available for viewing but not for adding/editing. The user should however can go to a separate section and add/edit to the same object.

Thanks in advance.

Like 0

Like

3 comments

Please open the detail schema in the configuration and override the method as described in the code below.

define("UsrSchema1Detail", [], function() {

    return {

        entitySchemaName: "UsrAccountDetail",

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        methods: {

            getAddRecordButtonVisible: function() {

                return false;

            }

        },

        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/

    };

});

 

https://academy.bpmonline.com/documents/technic-sdk/7-11/creating-custo…

Solution in previous comment didn't work for me. But this worked: 

 

define("UsrSchema1Detail", [], function () {

    return {

        entitySchemaName: "UsrSchema",

        details: {},

        diff: [{

            "operation": "merge",

            "name": "AddRecordButton",

            "values": {

                "visible": {

                    "bindTo": "isAddRecordButtonVisible"

                }

            }

        }],

        methods: {

            isAddRecordButtonVisible: function () {

                return UsrCommonUtilities.isTrainingCoordinator();

            }

        }

    };

});

 

Hi,

In a standard detail this worked for me:

methods: {
            getToolsVisible: function() {
                this.callParent(arguments);
                return false;
            }
        }

 

Show all comments