• Harshi_Pandey
  • NEWBIE
  • 25 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
I have a lightning tabset and lightning tabs inside which I have buttons, on the click of which I should see different data. 
I want to add and remove slds-button_brand style in button as in the code. It is working for First tab but not for other tabs. Can anyone help on this.
User-added image
Here is my code :
<lightning-tabset>
                <template for:each={FIInvestigation} for:item="FI">
				<lightning-tab key={FI.Id} label={FI.tabName} value={FI.tabvalue}>
				<span class="refHeading">Customer Residence Details</span><br><br>
                <lightning-layout multiple-rows="true" style="width:100%" class="slds-var-p-bottom_small slds slds-button_stretch">
                            <lightning-layout-item data-name="Individual" size="12" name="sstbutton" class="slds-var-p-bottom_small">
                                <div class="slds-m-top_medium" style="background-color: white;">
                                    <div class="slds-button-group" role="group" style="width: 100%;">
                                        <button data-name="sstbutton" data-btnlabel="SFEResidenceBtn" data-button={FI.tabvalue}
                                            class="slds-button slds-button_neutral slds-button_brand slds-button_stretch active"
                                            onclick={handleButtonClick}>SFE CVR</button>
                                        <button data-name="sstbutton" data-btnlabel="OnRollResidenceBtn" data-button={FI.tabvalue}
                                            class="slds-button slds-button_neutral slds-button_stretch inactive"
                                            onclick={handleButtonClick}>OnRoll FI</button>
                                    </div>
                                </div>
								<!--data-->
							</lightning-layout-item>
				</lightning-layout>
				</lightning-tab>
				</template>
</lightning-tabset>
 
loadcustomerInfo(leadID){
        getFIInformation({ leadId: leadID })
                    .then(result => {
                        if (result) {
                            console.log('FI Result -->' + JSON.stringify(result))
                            result.forEach(ele => {
                                this.value = this.value + 1;
                                let FI = {
                                        Id : ele.ApplicantId,
                                        Name : ele.ApplicantName,
                                        ApplicantType : ele.ApplicantType,
                                        tabName : ele.ApplicantType + ' ' + '(' + ele.ApplicantName + ')',
                                        tabvalue : this.value,
                                    }
                                this.FIInvestigation = [...this.FIInvestigation, FI];  
                            });
                            console.log('Field Investigation -->' + JSON.stringify(this.FIInvestigation))
                        }
                    }).catch(error => {
                        console.log('---error msg----->' + JSON.stringify(error));
                    });
    }
	
	hideandshow(){
        if(this.openpan == true){
            this.openpan = false;
            this.load = false;
        }
        else{
            this.openpan = true;
            if(this.load){
                this.loadcustomerInfo(this.recordId);
            }
        }   
    }
	
    handleButtonClick(event){
        if (event.currentTarget.dataset.name == "sstbutton") {
            console.log('inside sstbutton')
            if (event.currentTarget.dataset.btnlabel == 'SFEResidenceBtn') {
                console.log(event.currentTarget.dataset.btnlabel, event.currentTarget.dataset.button)
                this.template.querySelector(("button[data-btnlabel=OnRollResidenceBtn], button[data-button='"+event.currentTarget.dataset.button+"']")).classList.remove('slds-button_brand');
                this.template.querySelector(("button[data-btnlabel='"+event.currentTarget.dataset.btnlabel+"'], button[data-button='"+event.currentTarget.dataset.button+"'] ")).classList.add('slds-button_brand');
                this.SFEResidence = true;
                this.OnRollResidence = false;
            } 
            else if (event.currentTarget.dataset.btnlabel == 'OnRollResidenceBtn'){
                console.log(event.currentTarget.dataset.btnlabel, event.currentTarget.dataset.button)   
                this.template.querySelector(("button[data-btnlabel=SFEResidenceBtn]")).classList.remove('slds-button_brand');
                this.template.querySelector(("button[data-btnlabel='"+event.currentTarget.dataset.btnlabel+"']")).classList.add('slds-button_brand');   
                this.SFEResidence = false;
                this.OnRollResidence = true;
            }
        }
    }


 
Hi,
I have a requirement to store individual recipient's Name, Email and Status from the ListEmail object. I want to store these details separately depending on the individual status (Sent or failed).
User-added image
Please help me here.
I have a piece of code in my visualforce page which is using slds input text combobox. I have to display the list of account names when a person clicks on it.
Here is my code
<div class="slds-form-element">
    <label class="slds-form-element__label slds-assistive-text" for="example-unique-id-858" id="combobox-label-id-75">Search</label>
        <div class="slds-form-element__control">
            <div class="slds-combobox_container">
                <div class="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click">
                    <div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none">
                        <input type="text" class="slds-input slds-combobox__input" id="example-unique-id-858" placeholder="Quick Find"/>
                        <span class="slds-icon_container slds-icon-utility-search slds-input__icon slds-input__icon_right">
							<svg class="slds-icon slds-icon slds-icon_x-small slds-icon-text-default" aria-hidden="true">
								<use xmlns:xlink="http://www.w3.org/1999/xlink" 
									xlink:href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#search')}"></use>
							</svg>
                        </span>
                    </div>
                </div>
            </div>
        </div>
</div>
I have seen javascript controllers for lwc and aura. But I am having a visalforce page. Can anyone help me here.
Hello Everyone,

I have a child object SoldProducts__c whose parent object is 
Warehouse__c as a lookup relationship. I want to update a field in object Warehouse__c known as In_Stock__c with the value in the field
In_Stock__c in the child object SoldProducts__c with the help of apex trigger.
Please find the screenshots below for your reference:

User-added imageUser-added image

I tried the below code but no luck :
 
trigger SoldProduct on SoldProducts__c (before insert)
	{
	
		string ItemName;
		if(trigger.IsInsert && trigger.IsBefore)
		{
				for(SoldProducts__c sp : Trigger.new){
          			
                    ItemName = sp.Items__c;
				}				
		 for(SoldProducts__c  opp: Trigger.new)
    	{     
            List<SalesStock_Items__c> ssi = new List<SalesStock_Items__c>();
			
            SalesStock_Items__c si = [Select Warehouse__r.In_Stock__c from SalesStock_Items__c where Name like :ItemName];          
            si.Warehouse__r.In_Stock__c = opp.In_Stock__c;
            
			ssi.add(si);
            update ssi;
        }
		}
	}

Can anyone please help me here.
Hello All,

I have a custom object SoldProducts__c which is related to its parent object SalesStock_Items__c as a lookup relationship.
I want to update the lookup field 
'SalesStock_Item__c' present in SoldProducts__c custom object with the SalesStock_Items__c  Item Names i.e., the auto numbers generated like - 'SS-001, SS-002 ' in SalesStock_Items__c parent object whenever a new record is inserted in the SoldProducts__c child object.

User-added image

I tried the below trigger code:
trigger SoldProduct on SoldProducts__c (after insert) 	
	{  
		Map<String,Id> soldp = new Map<String,Id>();
		for(SoldProducts__c s : [Select Id, Items__c from SoldProducts__c where Id  IN :trigger.new])
   			{
  				soldp.put(s.Items__c ,s.Id);
  			}
        
   		SalesStock_Items__c sprod = [Select Id, Name from SalesStock_Items__c where Name IN:soldp.keyset()];
   		for(SoldProducts__c  opp: Trigger.new)
    		{     
        		opp.SalesStock_Item__c = sprod.Id ;  
            }
}
But I am getting the below error :
User-added imageCan anyone please help me how i can proceed in this case? 
 
I have a lightning tabset and lightning tabs inside which I have buttons, on the click of which I should see different data. 
I want to add and remove slds-button_brand style in button as in the code. It is working for First tab but not for other tabs. Can anyone help on this.
User-added image
Here is my code :
<lightning-tabset>
                <template for:each={FIInvestigation} for:item="FI">
				<lightning-tab key={FI.Id} label={FI.tabName} value={FI.tabvalue}>
				<span class="refHeading">Customer Residence Details</span><br><br>
                <lightning-layout multiple-rows="true" style="width:100%" class="slds-var-p-bottom_small slds slds-button_stretch">
                            <lightning-layout-item data-name="Individual" size="12" name="sstbutton" class="slds-var-p-bottom_small">
                                <div class="slds-m-top_medium" style="background-color: white;">
                                    <div class="slds-button-group" role="group" style="width: 100%;">
                                        <button data-name="sstbutton" data-btnlabel="SFEResidenceBtn" data-button={FI.tabvalue}
                                            class="slds-button slds-button_neutral slds-button_brand slds-button_stretch active"
                                            onclick={handleButtonClick}>SFE CVR</button>
                                        <button data-name="sstbutton" data-btnlabel="OnRollResidenceBtn" data-button={FI.tabvalue}
                                            class="slds-button slds-button_neutral slds-button_stretch inactive"
                                            onclick={handleButtonClick}>OnRoll FI</button>
                                    </div>
                                </div>
								<!--data-->
							</lightning-layout-item>
				</lightning-layout>
				</lightning-tab>
				</template>
</lightning-tabset>
 
loadcustomerInfo(leadID){
        getFIInformation({ leadId: leadID })
                    .then(result => {
                        if (result) {
                            console.log('FI Result -->' + JSON.stringify(result))
                            result.forEach(ele => {
                                this.value = this.value + 1;
                                let FI = {
                                        Id : ele.ApplicantId,
                                        Name : ele.ApplicantName,
                                        ApplicantType : ele.ApplicantType,
                                        tabName : ele.ApplicantType + ' ' + '(' + ele.ApplicantName + ')',
                                        tabvalue : this.value,
                                    }
                                this.FIInvestigation = [...this.FIInvestigation, FI];  
                            });
                            console.log('Field Investigation -->' + JSON.stringify(this.FIInvestigation))
                        }
                    }).catch(error => {
                        console.log('---error msg----->' + JSON.stringify(error));
                    });
    }
	
	hideandshow(){
        if(this.openpan == true){
            this.openpan = false;
            this.load = false;
        }
        else{
            this.openpan = true;
            if(this.load){
                this.loadcustomerInfo(this.recordId);
            }
        }   
    }
	
    handleButtonClick(event){
        if (event.currentTarget.dataset.name == "sstbutton") {
            console.log('inside sstbutton')
            if (event.currentTarget.dataset.btnlabel == 'SFEResidenceBtn') {
                console.log(event.currentTarget.dataset.btnlabel, event.currentTarget.dataset.button)
                this.template.querySelector(("button[data-btnlabel=OnRollResidenceBtn], button[data-button='"+event.currentTarget.dataset.button+"']")).classList.remove('slds-button_brand');
                this.template.querySelector(("button[data-btnlabel='"+event.currentTarget.dataset.btnlabel+"'], button[data-button='"+event.currentTarget.dataset.button+"'] ")).classList.add('slds-button_brand');
                this.SFEResidence = true;
                this.OnRollResidence = false;
            } 
            else if (event.currentTarget.dataset.btnlabel == 'OnRollResidenceBtn'){
                console.log(event.currentTarget.dataset.btnlabel, event.currentTarget.dataset.button)   
                this.template.querySelector(("button[data-btnlabel=SFEResidenceBtn]")).classList.remove('slds-button_brand');
                this.template.querySelector(("button[data-btnlabel='"+event.currentTarget.dataset.btnlabel+"']")).classList.add('slds-button_brand');   
                this.SFEResidence = false;
                this.OnRollResidence = true;
            }
        }
    }


 
Hi,
I have a requirement to store individual recipient's Name, Email and Status from the ListEmail object. I want to store these details separately depending on the individual status (Sent or failed).
User-added image
Please help me here.
Hello All,

I have a custom object SoldProducts__c which is related to its parent object SalesStock_Items__c as a lookup relationship.
I want to update the lookup field 
'SalesStock_Item__c' present in SoldProducts__c custom object with the SalesStock_Items__c  Item Names i.e., the auto numbers generated like - 'SS-001, SS-002 ' in SalesStock_Items__c parent object whenever a new record is inserted in the SoldProducts__c child object.

User-added image

I tried the below trigger code:
trigger SoldProduct on SoldProducts__c (after insert) 	
	{  
		Map<String,Id> soldp = new Map<String,Id>();
		for(SoldProducts__c s : [Select Id, Items__c from SoldProducts__c where Id  IN :trigger.new])
   			{
  				soldp.put(s.Items__c ,s.Id);
  			}
        
   		SalesStock_Items__c sprod = [Select Id, Name from SalesStock_Items__c where Name IN:soldp.keyset()];
   		for(SoldProducts__c  opp: Trigger.new)
    		{     
        		opp.SalesStock_Item__c = sprod.Id ;  
            }
}
But I am getting the below error :
User-added imageCan anyone please help me how i can proceed in this case?