1

I am trying to create a scratch org with the latest changes from my Production org which we recently turned on Event Monitoring. This is causing the following issue to occur on scratch org generation:

Required field is missing: eventLogRetentionDuration

I have the following Event.settings-meta.xml:

<?xml version="1.0" encoding="UTF-8"?>
<EventSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <enableDeleteMonitoringData>false</enableDeleteMonitoringData>
    <enableDynamicStreamingChannel>false</enableDynamicStreamingChannel>
    <enableEventLogGeneration>true</enableEventLogGeneration>
    <enableEventLogWaveIntegration>true</enableEventLogWaveIntegration>
    <enableStreamingApi>true</enableStreamingApi>
    <eventLogRetentionDuration>90</eventLogRetentionDuration>
</EventSettings>

This is in my scratch org definition:

...
    "eventSettings": {
      "enableEventLogGeneration": true,
      "enableTransactionSecurityPolicies": true,
      "enableDeleteMonitoringData": true,
      "enableLoginForensics": true,
      "enableStreamingApi": true,
      "enableDynamicStreamingChannel": false,
      "bypassMeteringBlock" :false
    }
...

Is there another file somewhere I am missing?

1 Answer 1

1

I believe you also need to specify the eventLogRetentionDuration in your scratch org definition file, so it should be:

...
    "eventSettings": {
      "enableEventLogGeneration": true,
      "enableTransactionSecurityPolicies": true,
      "enableDeleteMonitoringData": true,
      "enableLoginForensics": true,
      "enableStreamingApi": true,
      "enableDynamicStreamingChannel": false,
      "bypassMeteringBlock" : false,
      "eventLogRetentionDuration": 90
    }
...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .