function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Krishna Sahu 1Krishna Sahu 1 

Is it somting wron this

 <template if:true = {trialFollowUpCareCoordinator}>
                                    <c-lwc-lookup-component
                                                        object-api-name="User"
                                                        icon-name="standard:user"
                                                        lookup-label = "User"
                                                        onerror={showError}
                                                        filter="Profile.Name= 'Sales Representative' OR Profile.Name= 'Remote Care Team'"
                                                        onrecordselection = {updateSelectedUser}
                                                    >
                                    </c-lwc-lookup-component>
                                </template>
AnkaiahAnkaiah (Salesforce Developers) 
Hi Krishna,

What is the error?

Thanks!!
Krishna Sahu 1Krishna Sahu 1
I not not getting the User if i am using both sales rep and remote care in the filter
 
mukesh guptamukesh gupta
Hi Krishna,

error in this line : filter="Profile.Name= 'Sales Representative' OR Profile.Name= 'Remote Care Team'"

so you don't need this filter here , you can directly use this filter in your lwcLookupComponent

use below code:-
 
<template if:true = {trialFollowUpCareCoordinator}>
                                    <c-lwc-lookup-component
                                                        object-api-name="User"
                                                        icon-name="standard:user"
                                                        lookup-label = "User"
                                                        onerror={showError}
                                                        onrecordselection = {updateSelectedUser}
                                                    >
                                    </c-lwc-lookup-component>
                                </template>

lwcLookupComponent:-
 
import strUserId from '@salesforce/user/Id';
import PROFILE_NAME_FIELD from '@salesforce/schema/User.Profile.Name';
import {getRecord} from 'lightning/uiRecordApi';

export default class LwcLookupComponent extends LightningElement {
prfName;
userId = strUserId;

@wire(getRecord, {
    recordId: strUserId,
    fields: [PROFILE_NAME_FIELD]
}) wireuser({error,data}) {
    if (error) {
       this.error = error ; 
    } else if (data) {
        this.prfName =data.fields.Profile.value.fields.Name.value;  
        
        console.log('this.prfName ==>> ' +this.prfName);      
    }
}
   

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh

 
Krishna Sahu 1Krishna Sahu 1
I have to fetch by these two profiles.