Skip to content
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 a way to present timeline data using an Apex class #108

Closed
wants to merge 3 commits into from

Conversation

gmodica
Copy link

@gmodica gmodica commented Feb 4, 2021

In my project I had the requirement to show data in the timeline that is not available in salesforce objects, such as data that is produced by calculating and aggregating existing data, or even data that is not in Salesforce and needs to be retrieved by an API. I have added a way to show this data in the Timeline by adding a special custom metadata that references an apex class. The apex class implements an interface and provides the data to be showed in the timeline. I have included a simple example in the ContactCustomTimelineData.cls apex class.

To use the apex class you just specify the following string "apex:[classname]" in the Relationship Name of the custom metadata record. Take a look at the included sample metadata file called "Contact_Custom". I didn't want to create a new field as I wanted to keep the changes to a minimum, but I would say it would be better to create a field for this kind of metadata types.

I have also added the possibility to show a badge as part of the icon representing some status of the record. For example, for consents, a green badge icon shows that the consent was given and a red badge icon shows that the consent was removed.

Here's an example of how the data from the apex class looks like, along with the badge icon:

timelineWithApexData

@deejay-hub
Copy link
Owner

Thanks @gmodica. This is a super interesting and innovative use case! Give me some time to review what you've done and I'll get back to you. Grateful you took the time to share this with the community. Thank you.

@deejay-hub deejay-hub changed the base branch from main to ross July 9, 2023 06:37
@deejay-hub deejay-hub deleted the branch deejay-hub:ross October 16, 2023 05:56
@deejay-hub deejay-hub closed this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants