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

SOQL Datatable - query/filter for records owned by current user #84

Closed
solo-1234 opened this issue Apr 27, 2021 · 7 comments
Closed

SOQL Datatable - query/filter for records owned by current user #84

solo-1234 opened this issue Apr 27, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request salesforce dependency Custom solve overhead too high, wait on platform legos

Comments

@solo-1234
Copy link
Contributor

solo-1234 commented Apr 27, 2021

I'd like to configure a datatable (on flexipage) so that it shows each user a list of their records - either via record owner, or via a custom User lookup field. I don't see a way to do that currently.

(Current use case is showing sales reps a dynamic list of calls to make.)

Temporary workaround: create a boolean formula field on the object that compares the running user to the lookup field and filter on that.

Thanks!

@tsalb
Copy link
Owner

tsalb commented Apr 27, 2021

I believe I have access to userId via some import in LWC (double check later)

Additionally, I think this would align to $CurrentRecord API and just use the special string $CurrentUserId

@tsalb tsalb added the enhancement New feature or request label May 4, 2021
@tsalb
Copy link
Owner

tsalb commented May 4, 2021

Adding some cool context we figured out over the discord.

For this, I'd like to strongly align to what can be leveraged via LDS (read: don't use a custom apex class to back anything related to the UserInfo class).

The rationale here is I want to let this framework grow in alignment with LDS (which has some magic built in) and the net benefits of bringing the UserInfo class via custom class is, IMO, not worth the investment.

@tsalb tsalb added the salesforce dependency Custom solve overhead too high, wait on platform legos label May 4, 2021
@jamessimone
Copy link
Collaborator

@tsalb curious on your last comment (since the PR for this uses no Apex class); while LDS isn’t explicitly employed, I suspect the built-in I used leverages it under the hood

@tsalb
Copy link
Owner

tsalb commented May 5, 2021

@jamessimone oops yes, I haven't checked your PR and that comment was not directed at you (otherwise, it would be on the PR).

That was more additional context when psb and my convo on discord reached that conclusion. It was meant for future readers =D

@jamessimone
Copy link
Collaborator

cheers to posterity!

tsalb added a commit that referenced this issue May 7, 2021
Fix for #84 by adding CurrentUserId bind variable
@tsalb
Copy link
Owner

tsalb commented May 7, 2021

Closing this, but package has not been made yet.

Keep an eye on the next version when I get to that piece!

@tsalb tsalb closed this as completed May 7, 2021
@jamessimone
Copy link
Collaborator

Sounds good - thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request salesforce dependency Custom solve overhead too high, wait on platform legos
Projects
None yet
Development

No branches or pull requests

3 participants