Connect

Receiving onCustomEvent events to customize the Bitrix 24 interface

On the forums you can discuss and solve your IT questions about 1C:Enterprise, Bitrix24 and 1C Bitrix.
 
Paste this script into the console
Code
let originalBxOnCustomEvent = BX.onCustomEvent;

BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams) {

    let logData = {
        eventObject: eventObject,
        eventName: eventName,
        eventParams: eventParams,
        eventParamsClassNames: [],
        secureParams: secureParams
    };

    for (var i in eventParams) {
        let param = eventParams [i];
        if (param !== null && typeof param == 'object' && param.constructor) {
            logData['eventParamsClassNames'].push(param.constructor.name)
        } else {
            logData['eventParamsClassNames'].push(null);
        }
    }

    console.log(logData);

    originalBxOnCustomEvent.apply(null, [eventObject, eventName, eventParams, secureParams]);
}
After which all events that are called, for example, when a button is clicked, will be logged!
Users browsing this topic
file_download Download Module Market
file_download Download Module Market