• The new Learner
  • NEWBIE
  • 150 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 67
    Questions
  • 101
    Replies
HI Experts,

My below code is working fine, however, while creating a new child record, parentid is not populating automatically, again I am selecting to add that child record to parent, can anyone help me out. For example, in the account record related list if we create contact record automatically that specific accountid(name) will come on the record detail page of contact. Same functionality I need in my below component. can anyone help me out?
 
TEmpate:

<template>
<lightning-card title={titleWithCount} icon-name="standard:record">
    <lightning-button label="New" slot="actions" onclick={createNew}></lightning-button>
    <div slot="footer">
        <div  if:true={countBool}>
            <lightning-button label="View All" onclick={navigateToRelatedList}></lightning-button>
        </div>
    </div> 
    <div class="slds-m-around_medium">   
        <div if:true={listRecords}>   
            <template for:each={listRecords} for:item="rec">    
                <div key={rec.Id} class="slds-box">                         
                    <lightning-record-view-form record-id={rec.id} object-api-name={objectName}>
                        <div class="slds-grid">
                            <div class="slds-col slds-size_1-of-2">
                                <lightning-output-field field-name={field1}></lightning-output-field>
                                <lightning-output-field field-name={field2}></lightning-output-field>
                            </div>
                            <div class="slds-col slds-size_1-of-2">
                                <lightning-output-field field-name={field3}></lightning-output-field>
                                <lightning-output-field field-name={field4}></lightning-output-field>
                            </div>
                        </div>
                    </lightning-record-view-form><br/><br/>
                </div>                       
            </template>   
        </div>   
    </div>   
</lightning-card>       
</template>


JS:

import { LightningElement, api, wire, track } from 'lwc'; 
import fetchRecords from '@salesforce/apex/RelatedListController.fetchRecords'; 
import { NavigationMixin } from 'lightning/navigation';
 
export default class RelatedList extends NavigationMixin( LightningElement ) { 
 
    @api objectName; 
    @api parentObjectName;
    @api fieldName; 
    @api fieldValue; 
    @api parentFieldAPIName; 
    @api recordId; 
    @api strTitle; 
    @api filterType; 
    @api operator; 
    @api fieldsList;
    @api relationshipApiName;
    @track field1;
    @track field2;
    @track field3;
    @track field4;
    @track listRecords;
    @track titleWithCount;
    @track countBool = false;
    //@api recordid;

    connectedCallback() {

        var listFields = this.fieldsList.split( ',' );
        console.log( 'Fields are ' + listFields );
        this.field1 = listFields[ 0 ].trim();
        this.field2 = listFields[ 1 ].trim();
        this.field3 = listFields[ 2 ].trim();
        this.field4 = listFields[ 3 ].trim();
        console.log( 'Field 1 is ' + this.field1 );
        console.log( 'Field 2 is ' + this.field2 );
        console.log( 'Field 3 is ' + this.field3 );
        console.log( 'Field 4 is ' + this.field4 );

    }

    get vals() { 

        return this.recordId + '-' + this.objectName + '-' +  
               this.parentFieldAPIName + '-' + this.fieldName + '-' +  
               this.fieldValue + '-' + this.filterType + '-' + this.operator + '-' + this.fieldsList; 

    } 
     
    @wire(fetchRecords, { listValues: '$vals' }) 
    accountData( { error, data } ) {

        if ( data ) {
          
            this.listRecords = data.listRecords;
            console.log(JSON.stringify(this.listRecords));
            if ( data.recordCount ) {
               
                if ( data.recordCount > 3 ) {

                    this.titleWithCount = this.strTitle + '(3+)';
                    this.countBool = true;
               
                } else {

                    this.countBool = false;
                    this.titleWithCount = this.strTitle + '(' + data.recordCount + ')';

                }
            }

        }

    }

    createNew() {

        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: this.objectName,
                actionName: 'new'
            }
        });

    }

    navigateToRelatedList() {
       
        this[NavigationMixin.Navigate]({
            type: 'standard__recordRelationshipPage',
            attributes: {
                recordId: this.recordId,
                objectApiName: this.parentObjectName,
                relationshipApiName: this.relationshipApiName,
                actionName: 'view'
            }
        });

    }
 
}

Meta:

<?xml version="1.0" encoding="UTF-8"?> 
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="RelatedList"> 
    <apiVersion>52.0</apiVersion> 
    <isExposed>true</isExposed> 
    <targets> 
        <target>lightning__RecordPage</target> 
    </targets> 
    <targetConfigs> 
        <targetConfig targets="lightning__RecordPage"> 
            <property name="strTitle" type="String" label="Title" description="Enter the title"/> 
            <property name="objectName" type="String" label="Object Name" description="Enter the object name"/> 
            <property name="parentObjectName" type="String" label="Parent Object Name" description="Enter the parent object name"/> 
            <property name="relationshipApiName" type="String" label="Relationship Name" description="Enter the relationship API name"/> 
            <property name="parentFieldAPIName" type="String" label="Parent Field API Name" description="Enter the parent field API Name"/> 
            <property name="fieldName" type="String" label="Field Name" description="Enter the field name"/> 
            <property name="fieldValue" type="String" label="Field Value" description="Enter the field value"/> 
            <property name="filterType" type="String" label="Filter Type" description="Enter the filter type"/> 
            <property name="operator" type="String" label="Operator" description="Enter the operator"/> 
            <property name="fieldsList" type="String" label="Fields List" description="Enter the field API names separated by coma. Do not enter more than 4 fields"/> 
        </targetConfig> 
    </targetConfigs> 
</LightningComponentBundle>

 
Hi Experts,
 
How to create or edit a record based on the record type in LWC(component should be generic) can anyone help me out? 
Hi Experts,
 
Need to create a button two new buttons Record Create and Record Edit, by clicking on  Record Create button it has to open Record create a form with record type. similarly, by click on the Record Edit button, it has to open the Edit record form with record type. Can anyone help me out?
Hi  Experts,
 
I have requirement as follows , need to create a dropdown of accounts and on selecting specific account get a related list of contact with a specific field of that account with pagination
Hi Experts,

I need to create a button called Edit record, it will open the current record in edit view and the user can change details and save. can anyone help me, I have written below however it's not working for me.
 
Template:

<template>
    <template if:true={showRecScreen}>
        <lightning-record-edit-form
    object-api-name={objectApiName}
    record-id={recordId}>
        <lightning-input-field
            field-name={nameField}>
        </lightning-input-field>
        <div class="slds-var-m-top_medium">
            <lightning-button
                variant="brand"
                type="submit"
                label="Save">
            </lightning-button>
        </div>
</lightning-record-edit-form> 
    </template>
    <lightning-button name="Update" label="Updateedit" onclick={handleUpdate}></lightning-button>
</template>

JS:

import { LightningElement,api } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';

import NAME_FIELD from '@salesforce/schema/Account.Name';

export default class Editrecordeditformpage extends LightningElement {
    @api objectApiName = 'Account';
	showRecScreen = false;

    nameField = NAME_FIELD;

 
	
	handleUpdate(){
	this.showRecScreen = true;  
	}

    handleSuccess(event) {
        const evt = new ShowToastEvent({
            title: "Account created",
            message: "Record ID: " + event.detail.id,
            variant: "success"
        });
        this.dispatchEvent(evt);
    }

}

 
Hi Experts,

I have a requirement, if a user clicks on a button it needs to open the record create form and a user can create a related object record on save. can anyone help me on this?
Hi Experts, 
 
I need allow to edit the field called assitance__c on accountcontactrelationship record  by the Users in Assigned Territories (related list of an account) and system admin, account manager. can anyone help me out. how to achieve this.
Hi Experts,
 
I have written a trigger, when the opportunity contain inactive product I need to throw an error, however, its working fine for one product, when it have more than one , when I am trying to delete it's not working its throwing an error by saying  "select correct product"
can anyone help me out? 
 
public static void products(Set<Id> oppIds, List<Opportunity> opplist)
    {
        
        List<OpportunityLineItem> opplineitems = [SELECT OpportunityId FROM OpportunityLineItem WHERE Product2.IsActive = false AND OpportunityId IN: OppIds];
        
        Set<Id> opptyId = New Set<Id>();
        for(OpportunityLineItem opplt:opplineitems)
        {
            
            opptyId.add(opplt.OpportunityId);
        }
        
        for (Opportunity opp :opplist) 
        {
            
            if(opptyId.contains(opp.Id))
            {
                
                opp.addError('select correct product');

            }
        }
            
    }

 
Hi Experts,

I want to post a chatter on the event record on a daily basis when the event status-completed and When the Event Date is passed. Chatter should not update the same record in their next batch . Kindly help me out.
Hi Experts,

Can anyone help me out, how to achieve the below functionality using a trigger.

Need to link all contacts from the related account that are flagged as key contacts to an opportunity on that account when it is created.
Thanks in advance.
Hi Experts,

I have requirment i need to update account field  product_value__c with the  product  field Family__c( all the product values has to add to product value field),when ever the opprotunity stage is closed. to achieve this i have written batch class on opportunity but its not working as expected. Its taking lot of time to update records.
 
global class batchAccountUpdate implements Database.Batchable<sObject> {
    
    
    global Database.QueryLocator start(Database.BatchableContext BC) {
        
        String query = 'SELECT id,Accountid,stagename,IsRenewal__c FROM Opportunity ';
        
        return Database.getQueryLocator(query);
        
    }
    

    
    global void execute(Database.BatchableContext BC, List<Opportunity> scope) {
        
        set<id>accountids= new set<id>();
        set<id>opptyids= new set<id>();
        set<Id> addOn = new set<Id>();
        list<account>accountupdate= new list<account>();
        map<id,account> accmap = new map<id,account>();
        Map<id,OpportunityLineItem > accountid=new map<id,OpportunityLineItem >();  
         Map<id,Product2 > products=new map<id,Product2 >();
        for(Opportunity o : scope)
        {
            if(o.stagename=='closed')
            {
              
                opptyids.add(o.id);
            }  
            
        }
        
        for(Product2 oli : [SELECT id,Business__c,Family__c FROM Product2 where Business__c = 'sales']) 
        {
            
            addOn.add(oli.Id);
            products.put(oli.id,oli);
             
        }
        
        Map<Id,OpportunityLineItem > oppsToget = new Map<Id,OpportunityLineItem >([SELECT id,Product_Lookup__r.Business__c,Product_Lookup__r.Family__c,OpportunityId,Product_Lookup__c,opportunity.accountid,opportunity.StageName FROM OpportunityLineItem where Product_Lookup__c IN:products.keyset() and opportunityid in:opptyids]);
       
        for (OpportunityLineItem oli3: oppsToget.values())
        {
            accountid.put(oli3.opportunity.accountid,oli3);
           
            
        } 
        
        Map<Id,Account> mapAccount = new Map<Id,Account> ([select id,product_value__c from account where id in :accountid.keyset()]);    
        for(account a:mapAccount.values())
        {
            if(accountid.containskey(a.id))
            {
                system.debug('@@accountid.containskey(a.id)'+accountid.containskey(a.id)); 
                for(OpportunityLineItem line: accountid.values())
                {
                    if(line.Product_Lookup__c!= null)
                    {
                     
                           String prodstring='';
                           set<string>unique=new set<String>();  
                           for(String s:line.Product_Lookup__r.Family__c.split(','))
                           {
                           unique.add(s);
                            system.debug('@@unique'+unique);  
                           }
                            if(unique.size()!=0){
                        for(String st : unique ){  
                            prodstring = prodstring +','+ st;
                              system.debug('@@prodstring '+prodstring );
                            }
                         }
                        a.product_value__c = prodstring;
                      
                        accountupdate.add(a);
                      
                        
                       
                    }  
                }
            }
        }
        accmap.putall(accountupdate);

        if(!accmap.isEmpty()){
            Database.SaveResult[] IsShareResult = Database.update(accmap.values(), false);
            
        }
    }   
    
 
    
    global void finish(Database.BatchableContext BC) {
        
    }
    
}

 
HI Experts,

Can anyone help me out, how can i send an email to public group users under a queue based on language. Thanks in advance
HI Experts,

I want to send an email to queue members when ever the lead is created. when new lead is created its assigining to queue. now i want to send an email for queue users can anyone help me. thanks in advance
HI Experts,

I have written a visual force component and an apex class, problem over here is that, i can able to cover upto 73%, and not able to cover soql queries , lines which i bolded those are the lines which i am not able to cover. can anyone help me  please below is my code.
 
public with sharing class CampaignApprovalReject {
    
    
  public String camIds {get;set;}
    public Campaign camp{get;set;}
    Public ProcessInstanceStep pStep{get;set;}
    Public String sfdcBaseURL{get;set;}
    
    
    public CampaignApprovalReject (){
        
    }
    public ProcessInstanceStep getApprovalSteps() {
       
        if (camIds != null) 
        {
           
            pStep = [Select SystemModstamp,StepStatus, ProcessInstanceId, OriginalActorId,OriginalActor.Name,
                     Comments, ActorId From ProcessInstanceStep where ProcessInstance.TargetObjectId=:camIds order by SystemModstamp desc limit 1];  
            system.debug('@@@pStep'+pStep); 
        }
        return pStep ;
    }
    
    Public campaign getcampaigns(){
        if (camIds != null) 
        {
            camp= [Select id,name,Type,Description__c,ParentName__c from campaign where id=:camIds limit 1];
            
        }
        
        return camp;
    }
 
    
    public List<ProcessInstanceHistory> getrecallApprovalSteps() 
    {
        if (camIds != null) 
        {
            camp= [Select Id, (Select TargetObjectId, SystemModstamp, StepStatus, RemindersSent, ProcessInstanceId, OriginalActorId, IsPending, IsDeleted, Id, CreatedDate, CreatedById, Comments, ActorId From ProcessSteps order by SystemModstamp desc) from campaign where Id = :camIds ];
            return camp.ProcessSteps;
        }
        return new List<ProcessInstanceHistory>();
    }
    
    Public String getURL(){
        if (camIds != null) {
            sfdcBaseURL = URL.getSalesforceBaseUrl().toExternalForm()+'/'+camp.id;
        }
        return sfdcBaseURL;
    }
    
}

Below is my test class.
 
@isTest
public class Campaign_Test {
    @isTest static void myTest() 
    {
        
        Campaign a = new Campaign ();
        a.Name='Example';
        a.Description__c='test';
        a.Status='Planned';
        a.StartDate=system.today();
        a.CurrencyIsoCode='USD';
        a.Parent__c=true;
        a.type='Nurture';
        insert a;
        Campaign a2=[Select id,name,Type,CAP_WT_Campaign_Short_Description__c from campaign where name='Example' LIMIT 1];
        System.assert(a2!=null);        
        Approval.ProcessSubmitRequest req1 =  new Approval.ProcessSubmitRequest();
        req1.setComments('Submitting request for approval.');
        req1.setObjectId(a.id);
        req1.setProcessDefinitionNameOrId('Example_Process');
        req1.setSkipEntryCriteria(true);
        CampaignApprovalReject cmp = new CampaignApprovalReject();
        ProcessInstanceStep  process = cmp.getApprovalSteps();
        Campaign itemObj = cmp.getcampaigns();
        list<ProcessInstanceHistory> PI=cmp.getrecallApprovalSteps();
        string itemob=cmp.getURL();
        cmp.camIds='Example';
        System.assertEquals('Example', a.Name);
        
    }
}

 
HI Experts,

I have requirment where i need to create VF email template, using custom labels for each section to allow for users receiving the template to see it in their own language.  Can anyone help me how to create it.
HI Experts,

I have requirment where i need to login attempts of a community user ,its more than 5 login attempts , i need to populate an error message. can anyone help me please.
I have to populate the image based on the below conditions.

1. when the record type is "sales" or "service" and Date__c is greater than (Today() -160) then it should be green.
2. when the record type is "sales" or "service" and Date__c is less than (Today() -160) then it should be red.
3. when the record type is "sales" or "service" or "marketing" and status is not equal "renewed" and date__c <today then it should be red.
4. when image__c field is is not blank then it should it should be grey.

can anyone help me please.
Hi Experts,

I want to display a logo from second page page onwards, in an visulforce page can anyone help me how to do that.(from second page onwards that image has to be there in every page )
HI Experts,

Can anyone help me out, how to create below table format using html or apex table.
User-added image
Hi Experts,

I am rendering a pdf and populating data for every single record i want to break and again i need to show in seprate table next record. can anyone let me know please how to do that.
HI Experts,

My below code is working fine, however, while creating a new child record, parentid is not populating automatically, again I am selecting to add that child record to parent, can anyone help me out. For example, in the account record related list if we create contact record automatically that specific accountid(name) will come on the record detail page of contact. Same functionality I need in my below component. can anyone help me out?
 
TEmpate:

<template>
<lightning-card title={titleWithCount} icon-name="standard:record">
    <lightning-button label="New" slot="actions" onclick={createNew}></lightning-button>
    <div slot="footer">
        <div  if:true={countBool}>
            <lightning-button label="View All" onclick={navigateToRelatedList}></lightning-button>
        </div>
    </div> 
    <div class="slds-m-around_medium">   
        <div if:true={listRecords}>   
            <template for:each={listRecords} for:item="rec">    
                <div key={rec.Id} class="slds-box">                         
                    <lightning-record-view-form record-id={rec.id} object-api-name={objectName}>
                        <div class="slds-grid">
                            <div class="slds-col slds-size_1-of-2">
                                <lightning-output-field field-name={field1}></lightning-output-field>
                                <lightning-output-field field-name={field2}></lightning-output-field>
                            </div>
                            <div class="slds-col slds-size_1-of-2">
                                <lightning-output-field field-name={field3}></lightning-output-field>
                                <lightning-output-field field-name={field4}></lightning-output-field>
                            </div>
                        </div>
                    </lightning-record-view-form><br/><br/>
                </div>                       
            </template>   
        </div>   
    </div>   
</lightning-card>       
</template>


JS:

import { LightningElement, api, wire, track } from 'lwc'; 
import fetchRecords from '@salesforce/apex/RelatedListController.fetchRecords'; 
import { NavigationMixin } from 'lightning/navigation';
 
export default class RelatedList extends NavigationMixin( LightningElement ) { 
 
    @api objectName; 
    @api parentObjectName;
    @api fieldName; 
    @api fieldValue; 
    @api parentFieldAPIName; 
    @api recordId; 
    @api strTitle; 
    @api filterType; 
    @api operator; 
    @api fieldsList;
    @api relationshipApiName;
    @track field1;
    @track field2;
    @track field3;
    @track field4;
    @track listRecords;
    @track titleWithCount;
    @track countBool = false;
    //@api recordid;

    connectedCallback() {

        var listFields = this.fieldsList.split( ',' );
        console.log( 'Fields are ' + listFields );
        this.field1 = listFields[ 0 ].trim();
        this.field2 = listFields[ 1 ].trim();
        this.field3 = listFields[ 2 ].trim();
        this.field4 = listFields[ 3 ].trim();
        console.log( 'Field 1 is ' + this.field1 );
        console.log( 'Field 2 is ' + this.field2 );
        console.log( 'Field 3 is ' + this.field3 );
        console.log( 'Field 4 is ' + this.field4 );

    }

    get vals() { 

        return this.recordId + '-' + this.objectName + '-' +  
               this.parentFieldAPIName + '-' + this.fieldName + '-' +  
               this.fieldValue + '-' + this.filterType + '-' + this.operator + '-' + this.fieldsList; 

    } 
     
    @wire(fetchRecords, { listValues: '$vals' }) 
    accountData( { error, data } ) {

        if ( data ) {
          
            this.listRecords = data.listRecords;
            console.log(JSON.stringify(this.listRecords));
            if ( data.recordCount ) {
               
                if ( data.recordCount > 3 ) {

                    this.titleWithCount = this.strTitle + '(3+)';
                    this.countBool = true;
               
                } else {

                    this.countBool = false;
                    this.titleWithCount = this.strTitle + '(' + data.recordCount + ')';

                }
            }

        }

    }

    createNew() {

        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: this.objectName,
                actionName: 'new'
            }
        });

    }

    navigateToRelatedList() {
       
        this[NavigationMixin.Navigate]({
            type: 'standard__recordRelationshipPage',
            attributes: {
                recordId: this.recordId,
                objectApiName: this.parentObjectName,
                relationshipApiName: this.relationshipApiName,
                actionName: 'view'
            }
        });

    }
 
}

Meta:

<?xml version="1.0" encoding="UTF-8"?> 
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="RelatedList"> 
    <apiVersion>52.0</apiVersion> 
    <isExposed>true</isExposed> 
    <targets> 
        <target>lightning__RecordPage</target> 
    </targets> 
    <targetConfigs> 
        <targetConfig targets="lightning__RecordPage"> 
            <property name="strTitle" type="String" label="Title" description="Enter the title"/> 
            <property name="objectName" type="String" label="Object Name" description="Enter the object name"/> 
            <property name="parentObjectName" type="String" label="Parent Object Name" description="Enter the parent object name"/> 
            <property name="relationshipApiName" type="String" label="Relationship Name" description="Enter the relationship API name"/> 
            <property name="parentFieldAPIName" type="String" label="Parent Field API Name" description="Enter the parent field API Name"/> 
            <property name="fieldName" type="String" label="Field Name" description="Enter the field name"/> 
            <property name="fieldValue" type="String" label="Field Value" description="Enter the field value"/> 
            <property name="filterType" type="String" label="Filter Type" description="Enter the filter type"/> 
            <property name="operator" type="String" label="Operator" description="Enter the operator"/> 
            <property name="fieldsList" type="String" label="Fields List" description="Enter the field API names separated by coma. Do not enter more than 4 fields"/> 
        </targetConfig> 
    </targetConfigs> 
</LightningComponentBundle>

 
Hi Experts,

Can anyone help me how to write test class for the below method.

public override void onCommit(){
        
        OM_ManageService manageRemittanceSVC = (OM_ManageRService)this.svc;
        String accJSON = OM_WorkService.getJSONAttribute(manageRemittanceSVC.jsonString, 'AccountInfo');
        Map<String, List<SObject>> accObjects =  OM_WorkService.getSObjects(accJSON);
        Account acc = (Account)accObjects.get('Account')[0];
        
        if(acc!= null){
            upsert acc;
            super.onCommit();
            
            }
            
        Below is the OM_WorkService.getJSONAttribut    
             
             public static String getJSONAttribute(String jsonStr, String attr){
        Map<String, Object> m = (Map<String, Object>)JSON.deserializeUntyped(jsonStr);
        if(m.containsKey(attr))
            return (String)m.get(attr);
        
        return null;
    }
 
HI Experts,

My below code is working fine, however, while creating a new child record, parentid is not populating automatically, again I am selecting to add that child record to parent, can anyone help me out. For example, in the account record related list if we create contact record automatically that specific accountid(name) will come on the record detail page of contact. Same functionality I need in my below component. can anyone help me out?
 
TEmpate:

<template>
<lightning-card title={titleWithCount} icon-name="standard:record">
    <lightning-button label="New" slot="actions" onclick={createNew}></lightning-button>
    <div slot="footer">
        <div  if:true={countBool}>
            <lightning-button label="View All" onclick={navigateToRelatedList}></lightning-button>
        </div>
    </div> 
    <div class="slds-m-around_medium">   
        <div if:true={listRecords}>   
            <template for:each={listRecords} for:item="rec">    
                <div key={rec.Id} class="slds-box">                         
                    <lightning-record-view-form record-id={rec.id} object-api-name={objectName}>
                        <div class="slds-grid">
                            <div class="slds-col slds-size_1-of-2">
                                <lightning-output-field field-name={field1}></lightning-output-field>
                                <lightning-output-field field-name={field2}></lightning-output-field>
                            </div>
                            <div class="slds-col slds-size_1-of-2">
                                <lightning-output-field field-name={field3}></lightning-output-field>
                                <lightning-output-field field-name={field4}></lightning-output-field>
                            </div>
                        </div>
                    </lightning-record-view-form><br/><br/>
                </div>                       
            </template>   
        </div>   
    </div>   
</lightning-card>       
</template>


JS:

import { LightningElement, api, wire, track } from 'lwc'; 
import fetchRecords from '@salesforce/apex/RelatedListController.fetchRecords'; 
import { NavigationMixin } from 'lightning/navigation';
 
export default class RelatedList extends NavigationMixin( LightningElement ) { 
 
    @api objectName; 
    @api parentObjectName;
    @api fieldName; 
    @api fieldValue; 
    @api parentFieldAPIName; 
    @api recordId; 
    @api strTitle; 
    @api filterType; 
    @api operator; 
    @api fieldsList;
    @api relationshipApiName;
    @track field1;
    @track field2;
    @track field3;
    @track field4;
    @track listRecords;
    @track titleWithCount;
    @track countBool = false;
    //@api recordid;

    connectedCallback() {

        var listFields = this.fieldsList.split( ',' );
        console.log( 'Fields are ' + listFields );
        this.field1 = listFields[ 0 ].trim();
        this.field2 = listFields[ 1 ].trim();
        this.field3 = listFields[ 2 ].trim();
        this.field4 = listFields[ 3 ].trim();
        console.log( 'Field 1 is ' + this.field1 );
        console.log( 'Field 2 is ' + this.field2 );
        console.log( 'Field 3 is ' + this.field3 );
        console.log( 'Field 4 is ' + this.field4 );

    }

    get vals() { 

        return this.recordId + '-' + this.objectName + '-' +  
               this.parentFieldAPIName + '-' + this.fieldName + '-' +  
               this.fieldValue + '-' + this.filterType + '-' + this.operator + '-' + this.fieldsList; 

    } 
     
    @wire(fetchRecords, { listValues: '$vals' }) 
    accountData( { error, data } ) {

        if ( data ) {
          
            this.listRecords = data.listRecords;
            console.log(JSON.stringify(this.listRecords));
            if ( data.recordCount ) {
               
                if ( data.recordCount > 3 ) {

                    this.titleWithCount = this.strTitle + '(3+)';
                    this.countBool = true;
               
                } else {

                    this.countBool = false;
                    this.titleWithCount = this.strTitle + '(' + data.recordCount + ')';

                }
            }

        }

    }

    createNew() {

        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: this.objectName,
                actionName: 'new'
            }
        });

    }

    navigateToRelatedList() {
       
        this[NavigationMixin.Navigate]({
            type: 'standard__recordRelationshipPage',
            attributes: {
                recordId: this.recordId,
                objectApiName: this.parentObjectName,
                relationshipApiName: this.relationshipApiName,
                actionName: 'view'
            }
        });

    }
 
}

Meta:

<?xml version="1.0" encoding="UTF-8"?> 
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="RelatedList"> 
    <apiVersion>52.0</apiVersion> 
    <isExposed>true</isExposed> 
    <targets> 
        <target>lightning__RecordPage</target> 
    </targets> 
    <targetConfigs> 
        <targetConfig targets="lightning__RecordPage"> 
            <property name="strTitle" type="String" label="Title" description="Enter the title"/> 
            <property name="objectName" type="String" label="Object Name" description="Enter the object name"/> 
            <property name="parentObjectName" type="String" label="Parent Object Name" description="Enter the parent object name"/> 
            <property name="relationshipApiName" type="String" label="Relationship Name" description="Enter the relationship API name"/> 
            <property name="parentFieldAPIName" type="String" label="Parent Field API Name" description="Enter the parent field API Name"/> 
            <property name="fieldName" type="String" label="Field Name" description="Enter the field name"/> 
            <property name="fieldValue" type="String" label="Field Value" description="Enter the field value"/> 
            <property name="filterType" type="String" label="Filter Type" description="Enter the filter type"/> 
            <property name="operator" type="String" label="Operator" description="Enter the operator"/> 
            <property name="fieldsList" type="String" label="Fields List" description="Enter the field API names separated by coma. Do not enter more than 4 fields"/> 
        </targetConfig> 
    </targetConfigs> 
</LightningComponentBundle>

 
Hi Experts,
 
How to create or edit a record based on the record type in LWC(component should be generic) can anyone help me out? 
Hi  Experts,
 
I have requirement as follows , need to create a dropdown of accounts and on selecting specific account get a related list of contact with a specific field of that account with pagination
Hi Experts,

I have a requirement, if a user clicks on a button it needs to open the record create form and a user can create a related object record on save. can anyone help me on this?
Hi Experts,
 
I have written a trigger, when the opportunity contain inactive product I need to throw an error, however, its working fine for one product, when it have more than one , when I am trying to delete it's not working its throwing an error by saying  "select correct product"
can anyone help me out? 
 
public static void products(Set<Id> oppIds, List<Opportunity> opplist)
    {
        
        List<OpportunityLineItem> opplineitems = [SELECT OpportunityId FROM OpportunityLineItem WHERE Product2.IsActive = false AND OpportunityId IN: OppIds];
        
        Set<Id> opptyId = New Set<Id>();
        for(OpportunityLineItem opplt:opplineitems)
        {
            
            opptyId.add(opplt.OpportunityId);
        }
        
        for (Opportunity opp :opplist) 
        {
            
            if(opptyId.contains(opp.Id))
            {
                
                opp.addError('select correct product');

            }
        }
            
    }

 
Hi Experts,

I want to post a chatter on the event record on a daily basis when the event status-completed and When the Event Date is passed. Chatter should not update the same record in their next batch . Kindly help me out.
Hi Experts,

Can anyone help me out, how to achieve the below functionality using a trigger.

Need to link all contacts from the related account that are flagged as key contacts to an opportunity on that account when it is created.
Thanks in advance.
Hi Experts,

I have requirment i need to update account field  product_value__c with the  product  field Family__c( all the product values has to add to product value field),when ever the opprotunity stage is closed. to achieve this i have written batch class on opportunity but its not working as expected. Its taking lot of time to update records.
 
global class batchAccountUpdate implements Database.Batchable<sObject> {
    
    
    global Database.QueryLocator start(Database.BatchableContext BC) {
        
        String query = 'SELECT id,Accountid,stagename,IsRenewal__c FROM Opportunity ';
        
        return Database.getQueryLocator(query);
        
    }
    

    
    global void execute(Database.BatchableContext BC, List<Opportunity> scope) {
        
        set<id>accountids= new set<id>();
        set<id>opptyids= new set<id>();
        set<Id> addOn = new set<Id>();
        list<account>accountupdate= new list<account>();
        map<id,account> accmap = new map<id,account>();
        Map<id,OpportunityLineItem > accountid=new map<id,OpportunityLineItem >();  
         Map<id,Product2 > products=new map<id,Product2 >();
        for(Opportunity o : scope)
        {
            if(o.stagename=='closed')
            {
              
                opptyids.add(o.id);
            }  
            
        }
        
        for(Product2 oli : [SELECT id,Business__c,Family__c FROM Product2 where Business__c = 'sales']) 
        {
            
            addOn.add(oli.Id);
            products.put(oli.id,oli);
             
        }
        
        Map<Id,OpportunityLineItem > oppsToget = new Map<Id,OpportunityLineItem >([SELECT id,Product_Lookup__r.Business__c,Product_Lookup__r.Family__c,OpportunityId,Product_Lookup__c,opportunity.accountid,opportunity.StageName FROM OpportunityLineItem where Product_Lookup__c IN:products.keyset() and opportunityid in:opptyids]);
       
        for (OpportunityLineItem oli3: oppsToget.values())
        {
            accountid.put(oli3.opportunity.accountid,oli3);
           
            
        } 
        
        Map<Id,Account> mapAccount = new Map<Id,Account> ([select id,product_value__c from account where id in :accountid.keyset()]);    
        for(account a:mapAccount.values())
        {
            if(accountid.containskey(a.id))
            {
                system.debug('@@accountid.containskey(a.id)'+accountid.containskey(a.id)); 
                for(OpportunityLineItem line: accountid.values())
                {
                    if(line.Product_Lookup__c!= null)
                    {
                     
                           String prodstring='';
                           set<string>unique=new set<String>();  
                           for(String s:line.Product_Lookup__r.Family__c.split(','))
                           {
                           unique.add(s);
                            system.debug('@@unique'+unique);  
                           }
                            if(unique.size()!=0){
                        for(String st : unique ){  
                            prodstring = prodstring +','+ st;
                              system.debug('@@prodstring '+prodstring );
                            }
                         }
                        a.product_value__c = prodstring;
                      
                        accountupdate.add(a);
                      
                        
                       
                    }  
                }
            }
        }
        accmap.putall(accountupdate);

        if(!accmap.isEmpty()){
            Database.SaveResult[] IsShareResult = Database.update(accmap.values(), false);
            
        }
    }   
    
 
    
    global void finish(Database.BatchableContext BC) {
        
    }
    
}

 
HI Experts,

Can anyone help me out, how can i send an email to public group users under a queue based on language. Thanks in advance
HI Experts,

I want to send an email to queue members when ever the lead is created. when new lead is created its assigining to queue. now i want to send an email for queue users can anyone help me. thanks in advance