• kallam salesforce1
  • NEWBIE
  • 30 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 6
    Replies
HTML >>>
<template>
   
    <div class="slds-m-top_medium slds-m-bottom_x-large">
        <h2 class="slds-text-heading_medium slds-m-bottom_medium">
            Button-icons with the <code>variant</code> attribute omitted or set to the default value of <code>border</code>.
        </h2>
        <!-- with border / by default -->
        <div class="slds-p-around_medium lgc-bg">
            <lightning-button-icon icon-name="utility:add"  alternative-text="New Request" title="New request" onclick={showModalpopUp}></lightning-button-icon>
            <template if:true={isModalpopupTrue}>
                <!-- //<c-modal-popup-component></c-modal-popup-component> -->
                <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
                    <div class="slds-modal__container">
                     <!-- modal header start -->
                       <header class="slds-modal__header">
                          <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick={hideModalBox}>
                             <lightning-icon icon-name="utility:close"
                                alternative-text="close"
                                variant="inverse"
                                size="small" ></lightning-icon>
                             <span class="slds-assistive-text">Close</span>
                          </button>
                          <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Leave Request</h2>
                       </header>
                   
                       <!-- modal body start -->
                       <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                        <lightning-record-edit-form object-api-name={objectApiName}
                        record-id={recordId} onsuccess={handleSuccess}>
                        <lightning-messages></lightning-messages>
                        <lightning-input-field field-name={user}> </lightning-input-field>
                        <lightning-input-field field-name={FromDate}> </lightning-input-field>
                        <lightning-input-field field-name={Todate}> </lightning-input-field>
                        <lightning-input-field field-name={Reason}> </lightning-input-field>
                        <lightning-button  variant="brand"  type="submit" name="save" label="Save">
                        </lightning-button>
                        <lightning-button   type="submit" name="Cancel" label="Cancel" onclick={hideModalBox}>
                        </lightning-button>
                        </lightning-record-edit-form>
                             
                       </div>
             
                       <!-- modal footer start
                       <footer class="slds-modal__footer">
                        <lightning-button  variant="brand"  type="submit" name="save" label="Save">
                        </lightning-button>
                          <button class="slds-button slds-button_neutral" onclick={hideModalBox}>Cancel</button>
                       </footer> -->
                   
                    </div>
                 </section>
                 <div class="slds-backdrop slds-backdrop_open"></div>
           
            </template>
        </div>
        <div style="height: 300px;">
            <lightning-datatable
                    key-field="id"
                    data={tabledata}
                    columns={columns}
                    hide-checkbox-column
                    onrowaction={handleRowAction}>
            </lightning-datatable>
        </div>
    </div>        
</template>

Js file >>>>>>>>> 

 showModalpopUp(){
       this.isModalpopupTrue = true;
       console.log('Get the details of Lig input tag >>>>>>'+this.template.querySelectorAll("lightning-input-field"));
       
       this.template.querySelectorAll('lightning-input').forEach(element => {            
        element.value = null;
      });  
    }

Getting error as  >>
Get the details of Lig input tag >>>>>>SecureNodeList: [object NodeList]{ key: {"namespace":"c"} }

import updateParentCase from '@salesforce/apex/UpdateMotherCase.updateParentCase';
export default class InitiateMotherCase extends LightningElement {
    @api recordId;
    handleClick(event){
       console.log('Get the record Id is'+this.recordId);
       
       updateParentCase({rid:'$recordId'}).then(result =>{
              console.log('Get details'+result);
           }).catch( error => {});
       
    }

 

Apex method>>>>>

@AuraEnabled(cacheable=true)
    public static void updateParentCase(String rid){
        try{
        System.debug('Get the case record Id details'+rid);
        list<Case> c = [SELECT id,CaseNumber,ParentId,Recently_Updated__c from case  where id =: rid AND ParentId != null];
        System.debug('Get the case details'+c);

}

}

 

list<GroupMember> grpNameList = [SELECT UserOrGroupId, Group.DeveloperName FROM GroupMember WHERE Group.DeveloperName = 'Sales_Reports_Group'  AND Group.Type = 'Regular'];

Map<String,list<Id>> UserIdsWithGroupNames = new Map<String,List<Id>>();
 
for(GroupMember grp :grpNameList){
    if(!UserIdsWithGroupNames.containsKey(grp.Group.DeveloperName)){
         UserIdsWithGroupNames.put(grp.Group.DeveloperName, new List<Id>());
        
    }
    else{
        UserIdsWithGroupNames.get(grp.Group.DeveloperName).add(grp.UserOrGroupId);
    }
}
Map<Id, String> userEmailsById = new Map<Id, String>();
        // Get Emails from active users from group
        for(User u :[SELECT Id, Email FROM User WHERE Id IN :UserIdsWithGroupNames.values() AND IsActive = true]) {
            userEmailsById.put(u.Id, u.Email);
        }    

Help me how to resolve this issuse?
public with sharing class lDS_GetContacts_Wire2 {
    @AuraEnabled(cacheable=true)
    public static list<Contact> findContacts(string searchtext){
          string key = '%'+searchtext+'%';
          return [Select id,Name,Phone,Email from Contact where FirstName LIKE:key];
    }
}

HTML FILE

<template>
    <lightning-card title="Search Contact WIRE">
        <lightning-input label="Enter the Search Text" type="search" value={searchkey} onchange={handleOnchange}>
            <template if:true={contact.data}>
                <template for:each={contact.data} for:item="con">
                    <p key={con.id}>{con.Name}</p>
                </template>
            </template>
            <template if:true={contact.error}>
                Sorry we can't display your record due to {contact.error}. Please Try Later.
            </template>
        </lightning-input>
    </lightning-card>
</template>

Js File >>>>>>>
import { LightningElement,track,wire} from 'lwc';
import findcontacts from '@salesforce/apex/lDS_GetContacts_Wire2.findContacts'
export default class LDS_SearchContact_Wire extends LightningElement {
    @track searchkey;
    @wire (findcontacts,{searchtext :'$searchkey'}) contact;
    handleOnchange(event){
        this.searchkey = event.target.value;
    }
}