# "Enabled" field managed by DefaultRecordEncodingDelegate

**URL:** <https://forum.inductiveautomation.com/t/enabled-field-managed-by-defaultrecordencodingdelegate/111265>\
**Category:** Module Development\
**Created:** [October 8, 2025, 6:48am UTC](https://forum.inductiveautomation.com/t/enabled-field-managed-by-defaultrecordencodingdelegate/111265 "2025-10-08T06:48:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [October 8, 2025, 6:48am UTC](https://forum.inductiveautomation.com/t/enabled-field-managed-by-defaultrecordencodingdelegate/111265/1 "2025-10-08T06:48:36Z")

</div>

I’m writing the migration code for the 8.3 version of my module. I’m using this migration strategy code:

```python
    @Override
    public List<IdbMigrationStrategy> getRecordMigrationStrategies() {
        return List.of(new SingletonRecordMigrationStrategy(
                SeeqSettingsRecord.META,
                SeeqSettingsRecord.Id,
                IgnitionModuleConfigurationV2.RESOURCE_TYPE,
                DefaultRecordEncodingDelegate.newBuilder().build()
        ));
    }

```

In the **Ignition 8.3.0 SDK Migration Plan** PDF I got from support, it says this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/b/1bbd1b646e675171f791b15c24f52992ec8221f2.png)

I’m trying to figure out how these “ignored” fields work. Specifically, I need to access the Enabled field programmatically. I see that it’s stored on disk in `resource.json`, but where can I get at the enabled value from the code, and how can I write to it programmatically?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 9, 2025, 3:47pm UTC](https://forum.inductiveautomation.com/t/enabled-field-managed-by-defaultrecordencodingdelegate/111265/2 "2025-10-09T15:47:34Z")

</div>

If you have access to a raw `Resource` instance (probably as part of a `DecodedResource<?>`) then the easy, supported pattern is to use `com.inductiveautomation.ignition.common.util.ResourceUtil#isEnabled` - note that this method is defined to "fail true" - the absence of an enabled key or a malformed enabled key will return **true** , not false.  
But essentially all the method is doing is asking the `Resource` object for its defined attribute with the `com.inductiveautomation.ignition.common.util.ResourceUtil#ENABLED_KEY`.

Setting enabled status is the inverse operation - push a new modification operation that has the resource's enabled attribute set to the state you want. Exactly how to best do that depends on what level of abstraction you're working at, which will vary depending on whether you're creating an extension point, using our new `SingletonResourceHandler`/`NamedResourceHandler`, etc.

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [October 9, 2025, 4:46pm UTC](https://forum.inductiveautomation.com/t/enabled-field-managed-by-defaultrecordencodingdelegate/111265/3 "2025-10-09T16:46:00Z")

</div>

OK that helps Paul, I am indeed using `SingletonResourceHandler`, so here’s what my read code looks like based on your input:

```python
IgnitionModuleConfigurationV2 settings = this.settingsHandler.getResource();
Optional<Resource> settingsResource =
        this.context.getConfigurationManager()
                .getSingletonResource(IgnitionModuleConfigurationV2.RESOURCE_TYPE);

boolean enabled = true;
if (settingsResource.isPresent()) {
    enabled = ResourceUtil.isEnabled(settingsResource.get());
}

```

I’ve confirmed this works. I can manually change the `attributes.enabled` property in my resource’s `resource.json` file and see that it is reflected at runtime.

I need help on the inverse. I’m guessing maybe there’s some pattern involving `ConfigurationManager#push(PushOperation)` but I’m not seeing anything in the forum, docs or in the SDK examples. Can you help me with that?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 9, 2025, 4:49pm UTC](https://forum.inductiveautomation.com/t/enabled-field-managed-by-defaultrecordencodingdelegate/111265/4 "2025-10-09T16:49:31Z")

</div>

Here's the code used by the `system.device.setDeviceEnabled` scripting function, I think it should demonstrate what you need:

```java
Resource resource = context.getConfigurationManager()
    .getResource(new ResourcePath(DeviceExtensionPoint.DEVICE_RESOURCE_TYPE, deviceName))
    .orElseThrow(() -> new Exception("Device '" + deviceName + "' doesn't exist"));

Resource modifiedResource = resource.toBuilder()
    .setResourceCollectionName(resource.getDefiningCollectionName())
    .putAttribute("enabled", enabled)
    .build();

ChangeOperation modifyOp = ChangeOperation.newModifyOp(
    LastModification.update(modifiedResource, "unknown"),
    ResourceUtil.getTrueSignature(resource)
);

context.getConfigurationManager().push(List.of(modifyOp));

```

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [October 9, 2025, 5:02pm UTC](https://forum.inductiveautomation.com/t/enabled-field-managed-by-defaultrecordencodingdelegate/111265/5 "2025-10-09T17:02:22Z")

</div>

Thanks Kevin, this worked.

Here’s my final set of helper functions:

```python
public static boolean isEnabled(GatewayContext context) {
    Optional<Resource> settingsResource =
            context.getConfigurationManager()
                    .getSingletonResource(IgnitionModuleConfigurationV2.RESOURCE_TYPE);

    return settingsResource.map(ResourceUtil::isEnabled).orElse(true);

}

public static void setEnabled(GatewayContext context, boolean enabled) {
    Resource resource = context.getConfigurationManager()
            .getSingletonResource(IgnitionModuleConfigurationV2.RESOURCE_TYPE)
            .orElseThrow(() -> new RuntimeException("Settings resource not found"));

    Resource modifiedResource = resource.toBuilder()
            .setResourceCollectionName(resource.getDefiningCollectionName())
            .putAttribute("enabled", enabled)
            .build();

    ChangeOperation modifyOp = ChangeOperation.newModifyOp(
            LastModification.update(modifiedResource, "Seeq Settings UI"),
            ResourceUtil.getTrueSignature(resource)
    );

    try {
        context.getConfigurationManager().push(List.of(modifyOp));
    } catch (PushException e) {
        throw new RuntimeException(e);
    }
}

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 9, 2025, 8:27pm UTC](https://forum.inductiveautomation.com/t/enabled-field-managed-by-defaultrecordencodingdelegate/111265/6 "2025-10-09T20:27:11Z")

</div>

Feels like there's a missed opportunity - `SingletonResourceHandler` has a convenient `updateResource` but it only deals with your custom config type, doesn't support reaching out to the outer Ignition resource and overriding it. I'm going to file a ticket internally - we can probably patch in an extra overload that gives you the ability to override attributes at the same time.
