Skip to content

How to add Enable Objects system configuration in magento 2.4.6

Select objects to log actions when any admin users perform in the backend how to do?

system.xml

    <?xml version="1.0"?>

       <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
   <system>
    <tab id="vendor" translate="label" class="vendor" sortOrder="800">
        <label>Vendor Extensions</label>
    </tab>  
    <section id="vendor_module" translate="label" sortOrder="500" showInDefault="1" showInWebsite="1" showInStore="1">
        <label>Admin Action Log</label>
        <tab>vendor</tab>
        <resource>Vendor_Module::config</resource>
        <group id="general" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0">
            <label>General Configuration</label>
            <field id="enabled" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Enabled</label>
                <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>
            <field id="clear_action_logs_days" translate="label" type="text" sortOrder="60" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Automatically Clear Action Logs after ... Days</label>
                <validate>validate-number validate-zero-or-greater</validate>
            </field>
            <field id="enable_objects" translate="label" type="multiselect" sortOrder="110" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Enable Objects</label>
                 <source_model>vendormoduleModelConfigSourceOptions</source_model>
                <!--frontend_model>vendormoduleBlockAdminhtmlSystemConfigFormFieldCheckboxes</frontend_model-->
               
            </field>
        </group>
    </section>
</system>

enter image description here