({
init: function(cmp, evt, helper) {
var myPageRef = cmp.get("v.pageReference");
var propertyValue = myPageRef.state.c__defaultrecords;
cmp.set("v.defaultrecords", propertyValue);
}
})
My Apex Class:
public class GetForumMembers {
@AuraEnabled(cacheable = true)
public static List<user> getForumMember(){
return [Select Id,Name,SmallPhotoUrl from user limit 12];
}
}
Now you can use the view all functionalities from custom component.
Please close this thread by marking the best answer!!!
I am trying to use recordid here but its not working. Can you tell me what am i missing?
My Js Controller :- import { LightningElement, wire, api, track } from 'lwc'; import getForumMember from '@salesforce/apex/GetForumMembers.getForumMember'; import { NavigationMixin } from 'lightning/navigation';
export default class CustomForumMembers extends NavigationMixin(LightningElement) { @track users; @api recordId; @wire(getForumMember,{forumId: `$recordId`}) users } Apex controller:- public without sharing class GetForumMembers { @AuraEnabled(cacheable=true) public static List<User> getForumMember(String forumId) {
List<Forum_Members__c> forumMemberList = [Select id, Name,Member__c,Forum__c from Forum_Members__c Where Forum__c =: forumId ]; Set<Id> contactIds = new Set<Id>(); Map<Id,Id> mapOfUserIdToContactId = new Map<Id,Id>(); List<User> forumUsersList = New List<User>(); for( Forum_Members__c fm : forumMemberList ){ if( fm.Member__c != null ){ contactIds.add( fm.Member__c ); } } System.debug('contactIds'+contactIds); for( User ur : [ SELECT Id, ContactId FROM User WHERE ContactId IN : contactIds ] ){ if(ur.ContactId!= null){ mapOfUserIdToContactId.put( ur.id, ur.ContactId ); }
} System.debug('mapOfUserIdToContactId'+mapOfUserIdToContactId); forumUsersList = [SELECT Id, Name, SmallPhotoUrl from User where Id IN:mapOfUserIdToContactId.KeySet()]; System.debug('forumUsersList'+forumUsersList);
({
init: function(cmp, evt, helper) {
var myPageRef = cmp.get("v.pageReference");
var propertyValue = myPageRef.state.c__defaultrecords;
cmp.set("v.defaultrecords", propertyValue);
}
})
My Apex Class:
public class GetForumMembers {
@AuraEnabled(cacheable = true)
public static List<user> getForumMember(){
return [Select Id,Name,SmallPhotoUrl from user limit 12];
}
}
Now you can use the view all functionalities from custom component.
Please close this thread by marking the best answer!!!
You would need to create a VisualForce page or SControl which would allow the user to select a file from the local machine. 2) Read the file through Javascript. There are functions avaiable. Pasco Connect Login (https://www.mypascoconnect.biz/)
Hey, I am trying to create SControl (https://apkposh.com/cartoon-wars-3-mod-apk/) as per your instructions but it is not working properly. I tshows some error. Do you please guide me what type of error it is? Either a technical or systematic error? And how can I resolve this issue. Regards.
In the present issue, some of the representative papers which were discussed at that ... interrogations, etc., carried out by the members of the Commission. https://innoutsecretmenu.online/
I have done some changes and able to navigate like standard related list:
Please use by below components for your reference:
By default i will display only 5 records using this propert =====> @api defaultrecords = 5;
HTML:
JS:
Created one Aura Component for Navigation because LWC to LWC navigation won't work directly:
https://salesforcediaries.com/2020/06/07/navigate-to-lightning-web-component-from-another-lightning-web-component/
Component Name : NavigateToLWC JS:
My Apex Class:
Now you can use the view all functionalities from custom component.
Please close this thread by marking the best answer!!!
Thanks,
Maharajan.C
All Answers
Please follow below url:-
https://www.infallibletechie.com/2020/04/reusable-related-list-using-lwc-in.html
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Thanks for the reply. How can i show the profile picture like this and the users in side by side. Right now its showing like this
My component is given below:-
<template>
<lightning-card title="Forum members" icon-name="standard:record">
<div class = "slds-var-m-around_medium">
<template if:true={users.data}>
<template for:each={users.data} for:item = "member">
<div key={member.id}>
<img src={member.SmallPhotoUrl} />
<br/><br/>
{member.Name}
</div>
</template>
</template>
</div>
</lightning-card>
</template>
Controller:-
import { LightningElement, wire, api, track } from 'lwc';
import getForumMember from '@salesforce/apex/GetForumMembers.getForumMember';
export default class CustomForumMembers extends LightningElement {
@track users;
@wire(getForumMember)
users
}
When i am trying your code with some small change am able to see the below result:
Thanks,
Maharajan.C
Thanks for your reply, I have created it and it looks like this now
How can we navigate it to the Forum members after clicking on View All like we do in standard related list?
My Js Controller :-
import { LightningElement, wire, api, track } from 'lwc';
import getForumMember from '@salesforce/apex/GetForumMembers.getForumMember';
import { NavigationMixin } from 'lightning/navigation';
export default class CustomForumMembers extends NavigationMixin(LightningElement) {
@track users;
@api recordId;
@wire(getForumMember,{forumId: `$recordId`})
users
}
Apex controller:-
public without sharing class GetForumMembers {
@AuraEnabled(cacheable=true)
public static List<User> getForumMember(String forumId) {
List<Forum_Members__c> forumMemberList = [Select id, Name,Member__c,Forum__c from Forum_Members__c Where Forum__c =: forumId ];
Set<Id> contactIds = new Set<Id>();
Map<Id,Id> mapOfUserIdToContactId = new Map<Id,Id>();
List<User> forumUsersList = New List<User>();
for( Forum_Members__c fm : forumMemberList ){
if( fm.Member__c != null ){
contactIds.add( fm.Member__c );
}
}
System.debug('contactIds'+contactIds);
for( User ur : [ SELECT Id, ContactId
FROM User
WHERE ContactId IN : contactIds ] ){
if(ur.ContactId!= null){
mapOfUserIdToContactId.put( ur.id, ur.ContactId );
}
}
System.debug('mapOfUserIdToContactId'+mapOfUserIdToContactId);
forumUsersList = [SELECT Id, Name, SmallPhotoUrl from User where Id IN:mapOfUserIdToContactId.KeySet()];
System.debug('forumUsersList'+forumUsersList);
return forumUsersList;
}
}
I have done some changes and able to navigate like standard related list:
Please use by below components for your reference:
By default i will display only 5 records using this propert =====> @api defaultrecords = 5;
HTML:
JS:
Created one Aura Component for Navigation because LWC to LWC navigation won't work directly:
https://salesforcediaries.com/2020/06/07/navigate-to-lightning-web-component-from-another-lightning-web-component/
Component Name : NavigateToLWC JS:
My Apex Class:
Now you can use the view all functionalities from custom component.
Please close this thread by marking the best answer!!!
Thanks,
Maharajan.C
Regards.
In the present issue, some of the representative papers which were discussed at that ... interrogations, etc., carried out by the members of the Commission. https://innoutsecretmenu.online/