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

Master Sync : Auto Generated PR #264

Merged
merged 1 commit into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Custom Data types (the component extendedDatatable extends lightning:datatable)
| Enter Related field API Name | :x: | String | Enter related field API name | Example AccountId for contact when component is on account layout. |
| Formula Image Field API Names | :x: | String | Enter formula field API names **Note** : This is mandatory for formula fields displaying images | \["FormulaField__c"\] |
| Hide/Unhide checkbox column | :x: | Boolean | true/false | Hide/Unhide Checkbox |
| Enter WHERE clause | :x: | String | provide aditional filters | Example `LastName like '%s' AND Account.Name like '%t'` |
| Enter WHERE clause | :x: | String | provide aditional filters | Example `LastName like '%s' AND Account.Name like '%t' AND AccountId = 'recordId' AND CreatedById = 'connectedUserId'` <br> **Note** : `'recordId' filter support detail page only` |
| Group by | :x: | String | set the group by clause | Example `AccountId` |
| Order by | :x: | String | set the order by clause | Example `LastName, Account.Name DESC` |
| Enter limit | :x: | Integer | limit the displayed number of records for the list | an integer |
Expand Down
12 changes: 11 additions & 1 deletion force-app/main/default/lwc/lwcRelatedList/lwcRelatedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from './lwcRelatedListHelper';
import recordUpdatedSuccessMessage from '@salesforce/label/c.recordUpdatedSuccessMessage';
import recordDeletedSuccessMessage from '@salesforce/label/c.recordDeletedSuccessMessage';
import Id from "@salesforce/user/Id";
const actions = [
{ label: 'Show details', name: 'show_details' },
{ label: 'Edit', name: 'edit' },
Expand Down Expand Up @@ -51,6 +52,7 @@ export default class LwcDatatable extends NavigationMixin(LightningElement) {
@api lookupFilterConfigJSON;
// Private Property
@api oldPredefinedCol = '';
connectedUserId = Id
@track data;
@track soql;
@track offSet = 0;
Expand Down Expand Up @@ -460,7 +462,15 @@ export default class LwcDatatable extends NavigationMixin(LightningElement) {
let where = [];
if (this.relatedFieldAPI)
where.push(`${this.relatedFieldAPI} = '${this.recordId}'`);
if (this.whereClause) where.push(this.whereClause);
if (this.whereClause) {
where.push(this.whereClause);
if(this.whereClause.includes('recordId')){
this.whereClause.replace('recordId', this.recordId)
}
if(this.whereClause.includes('connectedUserId')){
this.whereClause.replace('connectedUserId', this.connectedUserId)
}
}
if (this.lookupFilterCondition) where.push(this.lookupFilterCondition);
return where.length > 0 ? ` WHERE ${where.join(' AND ')} ` : '';
}
Expand Down
Loading