Add the ability to set custom fields once per transaction/on every LogEntryEvent__e record #769
Labels
Feature: Custom Field Mappings
Items related to custom field mappings functionality
Layer: Log Management
Items related to the custom objects & Logger Console app
Layer: Logger Engine
Items related to the core logging engine
Logging Source: Apex
Items related to using Logger within Apex
Type: Bug
Something isn't working
Type: Enhancement
New feature or request
Milestone
This idea came up today on SFXD with @surajp. In release
v4.13.14
, a new instance method was added -LogEntryEventBuilder.setField()
- to set custom fields onLogEntryEvent__e
:LogEntry__c
)Log__c
).Log__c
field is correctly populated. But doing it on every entry in a transaction is very tedious / not a great developer experienceIdeally, developers should only have to set the transaction-level fields once per transaction. This should be handled with 2 changes:
Logger.setField(SObjectField field, Object value)
: This will give Apex developers a method that can be called once per transaction for a field, and all generatedLogEntryEvent__e
records will have it setLog__c
mappings inLogEntryEventHandler
: Right now, the trigger handler creates aLog__c
record the first time it finds aLogEntryEvent__e
record with a specific transaction ID - and then skips the log-related code for any subsequent events with the same transaction ID. In some situations, someLog__c
data could be loss, so I'd like to improve how it worksevent A
hasSomeLogField__c = null
, andevent B
hasSomeLogField__c = 'some value'
, then the generatedLog__c
could have anull
value, if both events are published/processed in the same async transactionThe text was updated successfully, but these errors were encountered: