-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for custom field mappings in Apex #664
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jongpie
added
Type: Enhancement
New feature or request
Salesforce Feature: Reporting
Anything related to reports, dashboards, and the underlying data model
Logging Source: Apex
Items related to using Logger within Apex
Layer: Configuration
Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type
Layer: Log Management
Items related to the custom objects & Logger Console app
Layer: Logger Engine
Items related to the core logging engine
labels
Apr 9, 2024
jongpie
had a problem deploying
to
Base Scratch Org
April 9, 2024 17:09
— with
GitHub Actions
Failure
jongpie
had a problem deploying
to
Experience Cloud Scratch Org
April 9, 2024 17:09
— with
GitHub Actions
Failure
jongpie
temporarily deployed
to
Experience Cloud Scratch Org
April 9, 2024 18:26
— with
GitHub Actions
Inactive
jongpie
force-pushed
the
feature/custom-field-mappings
branch
2 times, most recently
from
April 24, 2024 03:16
12f77cb
to
4ece9ca
Compare
jongpie
temporarily deployed
to
Experience Cloud Scratch Org
April 24, 2024 03:20
— with
GitHub Actions
Inactive
jongpie
temporarily deployed
to
Base Scratch Org
April 24, 2024 03:20
— with
GitHub Actions
Inactive
jongpie
force-pushed
the
feature/custom-field-mappings
branch
from
July 7, 2024 19:12
36b8ea7
to
71af08d
Compare
jongpie
temporarily deployed
to
Experience Cloud Scratch Org
July 7, 2024 19:16
— with
GitHub Actions
Inactive
jongpie
temporarily deployed
to
Experience Cloud Scratch Org
July 7, 2024 20:06
— with
GitHub Actions
Inactive
jongpie
commented
Jul 7, 2024
...core/main/configuration/objects/LoggerFieldMapping__mdt/fields/TargetField__c.field-meta.xml
Show resolved
Hide resolved
...LoggerFieldMapping__mdt/validationRules/UnsupportedSourceSObjectType.validationRule-meta.xml
Show resolved
Hide resolved
...LoggerFieldMapping__mdt/validationRules/UnsupportedTargetSObjectType.validationRule-meta.xml
Show resolved
Hide resolved
jongpie
commented
Jul 7, 2024
nebula-logger/core/main/logger-engine/classes/LogEntryEventBuilder.cls
Outdated
Show resolved
Hide resolved
…se to PascalCase Some legacy/older validation rules use Snake_Case, but overall, PascalCase is used for all metadata in Nebula Logger
…ate methods before non-test-visible private methods
…on layer (instead of the log management layer) It's only used by the log management layer, but since it (generically) manages field mappings, it's really part of the configuration layer
…luded custom fields (also stored in the extra-tests directory) These CMDT records are just to help with functionally/manually testing in a scratch org - they won't be included in any of the packages
jongpie
force-pushed
the
feature/custom-field-mappings
branch
from
July 11, 2024 18:19
6be1b80
to
0ce0424
Compare
jongpie
had a problem deploying
to
Experience Cloud Scratch Org
July 11, 2024 18:24
— with
GitHub Actions
Failure
jongpie
temporarily deployed
to
Experience Cloud Scratch Org
July 11, 2024 18:42
— with
GitHub Actions
Inactive
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #664 +/- ##
==========================================
- Coverage 95.66% 95.51% -0.15%
==========================================
Files 50 51 +1
Lines 5604 5687 +83
==========================================
+ Hits 5361 5432 +71
- Misses 243 255 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
jongpie
force-pushed
the
feature/custom-field-mappings
branch
from
July 11, 2024 21:06
947ae2e
to
c196393
Compare
This approach is more consistent with the singular naming convention used by other builder method overloads, like setRecord()
jongpie
force-pushed
the
feature/custom-field-mappings
branch
4 times, most recently
from
July 12, 2024 17:54
a6f4b6d
to
feae243
Compare
…s, and cleaned up/updated some other README contents Also added .github/FUNDING.yml so the repo has a sponsor button
jongpie
force-pushed
the
feature/custom-field-mappings
branch
from
July 12, 2024 18:01
feae243
to
d4787c6
Compare
jongpie
added
the
Feature: Custom Field Mappings
Items related to custom field mappings functionality
label
Jul 15, 2024
This was referenced Jul 15, 2024
jongpie
changed the title
Added support for custom field mappings
Added support for custom field mappings in Apex
Sep 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Feature: Custom Field Mappings
Items related to custom field mappings functionality
Layer: Configuration
Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type
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
Salesforce Feature: Reporting
Anything related to reports, dashboards, and the underlying data model
Type: Enhancement
New feature or request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #655 by adding support for defining, setting, and mapping custom fields within Nebula Logger's data model. This is helpful in orgs that want to extend Nebula Logger's included data model by creating their own org/project-specific fields.
Adding custom fields to the platform event
LogEntryEvent__e
For orgs that only use
LogEntryEvent__e
(and don't leverage the custom objects), they can now...Create their own custom fields on
LogEntryEvent__e
. Any data type supported by platform events can be used.In this example, a custom text field called
SomeCustomField__c
has been added:Populate their own custom fields in Apex by calling the instance method overloads
LogEntryEventBuilder.setField(Schema.SObjectField field, Object fieldValue)
orsetField(Map<Schema.SObjectField, Object> fieldToValue)
.Logger.info('hello, world').setField(LogEntryEvent__e.SomeCustomField__c, 'some value');
Adding custom fields to the custom objects
Log__c
,LogEntry__c
, andLoggerScenario__c
For orgs that want to store the data in one of Nebula Logger's custom objects, they can follow the above steps, and also...
Create their own custom fields on one of Nebula Logger's custom objects - right now, only
Log__c
,LogEntry__c
, andLoggerScenario__c
are supported.In this example, a custom text field also called
SomeCustomField__c
has been added toLog__c
object - this will be used to store the value of the fieldLogEntryEvent__e.SomeCustomField__c
:Create a record in the new CMDT
LoggerFieldMapping__mdt
to map theLogEntryEvent__e
custom field to the custom object's custom field, shown below. Nebula Logger will automatically populate the custom object's target field with the value of the sourceLogEntryEvent__e
field.In this example, a custom text field called
SomeCustomField__c
has been added to bothLogEntryEvent__e
andLog__c
.