preOpenObject - Access property

Hello everybody,

I’m trying to access the noteditable property on the preOpenObject hook in order to change dynamically the status of a field.

Here is my code from startup.js

preOpenObject: function (obj, type) {
        console.log('object', obj);
        var objectType = obj.edit.dataFields.GroupingProperty.fieldConfig.noteditable

GroupingProperty is a field.

When I run it, this is my result:

Any help would be highly appreciated.

Thank you.

If you change the fields before send it to browser you have to use custom EventListener (pimcore.admin.dataobject.get.preSendData, list all available admin events is ). It modifies fields, property before show in browser. See for example - MyEventListener and access to the data and object.

Took me a while to revisit this topic. Thank you for the support.