Skip to content

Commit

Permalink
Merge pull request #264 from Sarveshgithub/dev
Browse files Browse the repository at this point in the history
Master Sync : Auto Generated PR
  • Loading branch information
Sarveshgithub authored Feb 11, 2024
2 parents 1bfb821 + 60ebd46 commit df2ee0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit df2ee0f

Please sign in to comment.