Skip to content

CustomDataProvider recordId #137

Answered by scolladon
mrcdsouza asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @mrcdsouza,

Yes the DemoDataProvider does not show how to use the recordId parameter.

The code passes the recordId value when the handler is set using the chartBuilder LWC component.
This code then call the backend with this value as input (casted to Object)
The backend then call the init method of your custom handler with this input parameter
The init method is abstract so it means its implementation is at your discretion.

You could have a custom data provider that store this input and use it in the getData method

global inherited sharing class SampleDataProvider extends ChartDataProvider {

  protected String recordId;

  public override void init(final Object initParameter) {
    this.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@mrcdsouza
Comment options

Answer selected by mrcdsouza
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants