#Lightning Web Components6 discussing
- Recent Activity
- Created Date
- Recommended
- All Questions
- Questions with an Accepted Answer
- Unanswered Questions
- Questions with No Accepted Answer
I use the Lightning Component "Tab" on a lightning page. Is there a way to get the URL to one of the component's tabs? Hovering over a tab just shows "javascript:void(0)".
For example, I want to give a user a direct link to the "Decisions" tab. But I can't because I don't know the URL to that tab.
Thanks,
Marc
Sep 23, 2021, 9:58 PM It looks like there is an Idea for this: https://trailblazer.salesforce.com/ideaView?id=0874V000000U5B8QAK
Hello All,
Is there a way to edit fields (similar to inline editing) on a related list on a Lightning Record page? To clarify, I don't mean edit the fields to display, I mean actually updating a field, like adding a data to a date or name field on the related record directly from the lightning record page.
Thank you!
Hindy
Apr 11, 5:04 PM Universal Data Grid (UDG) has all this and more:
https://appexchange.salesforce.com/appxListingDetail?listingId=e35860e0-9d5d-40a8-ac6b-4cf8d5d17b66
https://www.youtube.com/watch?v=E5JQZmqrnr0&feature=youtu.be
Preventing Recursive Lightning Message Service Calls in Screen Flow LWCs Using a Source Flag
When working with Lightning Message Service (LMS) inside Screen Flow embedded LWCs, communication between components becomes extremely powerful — but it can also introduce unexpected recursive behaviour.
Recently, I encountered an interesting real-world scenario where two LWCs on a Screen Flow were unintentionally triggering each other repeatedly, causing incorrect value population even though the logic looked perfectly fine.
This blog walks through:
- The Scenario
- The Problem
- Debugging Process
- Root Cause
- The Solution (Using Source Flag)
- Best Practices
- Final Takeaways
Scenario
I had a Screen Flow containing two Lightning Web Components:
- LWC A — Publishes some values
- LWC B — Publishes some values
- Both components subscribe to the same Lightning Message Channel
So essentially:
- LWC A publishes → LWC B receives
- LWC B publishes → LWC A receives
This setup is valid and expected — and initially, everything worked correctly.
However, as the use case evolved, values started getting populated incorrectly
.
The Issue
Even though:
- Logic was correct
- Variables were correct
- Message structure was correct
The values were getting overwritten incorrectly.
Example Behavior:
- LWC A publishes value
- LWC B receives and updates
- LWC B publishes updated value
- LWC A receives again
- LWC A publishes again
- Loop continues...
This created a recursive publish-subscribe loop
.
Debugging Approach
To identify the issue:
- Added console logs
- Checked publish events
- Checked subscription callbacks
While debugging, I noticed:
- Publish method firing multiple times
- Subscription handler triggering repeatedly
- Unexpected value overwrites
This clearly indicated recursive message passing
.
Root Cause
The root cause was:
Since both components:
- Subscribe
- Update values
- Publish again
It resulted in infinite cross-communication.
This is a common pitfall when using Lightning Message Service with multiple publishers
.
The Solution — Using a Source Flag
To stop recursion, I introduced a Source Flag inside the message payload.
The idea:
- Each LWC sends its name as source
- When receiving a message:
- If message source == current LWC
- Ignore the message
This prevents recursive triggering.
Example Message Payload
{
value: selectedValue,
source: 'LWC_A'
}
Implementation Example
Publisher
publishMessage() {
const message = {
value: this.selectedValue,
source: 'LWC_A'
};
publish(this.messageContext, SAMPLEMC, message);
}
Subscriber
subscribeMessage() {
this.subscription = subscribe(
this.messageContext,
SAMPLEMC,
(message) => {
if(message.source === 'LWC_A') {
return;
}
this.selectedValue = message.value;
}
);
}
Now the flow becomes:
- LWC A publishes (source = LWC A)
- LWC B receives
- LWC B updates UI
- LWC B publishes (source = LWC B)
- LWC A receives
- LWC A updates UI
- No recursion
#Lightning Web Components #Lightning Message Channel #Salesforce Developer #Issues
I have created an LWC where the related Apex class is querying the approval history object for all the objects and filter all records where the current user has been delegated for the approval of any of these records.
The LWC is displaying the results (records to be approved) in a similar way as the standard component “Items to Approve” does.
The functionality works well for admin users, if the user is admin and delegated approver, he can view all the approvals. but the records are not showing to the non admin users. Although I have mentioned that the class is as "without sharing".
Can anyone guide me what I am missing, What can be done to fix this issue?
Search (lookup) with Record Picker Component - for Field Service Mobile now available in Beta!
Hi Everyone
If you ever wanted a Lookup capability that can be used to search and select records in offline scenarios your wait is over! We are happy to announce that Record Picker is available as a new lightning base component and can be used in custom applications for offline or online scenarios for mobile (or desktop). The component is in Beta phase in Winter '24 release for you to try out. Please provide any feedback or suggestions as you use the component. Links to relevant docs below.
For any feedback please reply to this thread or reach out to me or @Aurélie Merlin
Mar 27, 5:19 PM Hello @Aurélie Merlin @Niket Trivedi
Lightning record picker is awesome to use and i have been replacing my custom solution with this utility, could we please explore adding these features as well please !
- Limit the no of records in search result list so that user has flexibility to show lets say top 5 results.
- when a selected value is being cleared out , the search is expanding to show last search results by default, until we get the feature of MRU we should stop showing that list upfront as the search box is blank upon clearing.
looking forward to get new updates on this soon :)
#Lightning-record-picker
Current error "Cannot find Lightning Component Bundle lwc learning." Apparently at some point I created an LWC called lwc learning or lwc_learning. I now can't find the folder or file but when attempting to deploy source to org I can't do it :( Is there a way to ignore this file or folder specifically? Or even better find and remove the reference. Please halp.
#SFDX CLI #Lightning Web Components #Lightning Configuration
Feb 11, 2:45 PM I know this question is old, but I had a similar problem: the error indicated that itcouldn't find lwc 'ProjectAccounts' but I didn't even code a LWC with this name. Noticed that it was the exact name of my parent/project folder, not an old LWC.
So I renamed it with LowerCase only ( ProjectAccounts -> project-accounts) and it worked!! Maybe it's a problem with naming the sf project with Upper case
Also I used the following command in the terminal:
sf project deploy start --source-dir force-app/main/default/lwc/<YOUR-LWC-NAME> --target-org <YOUR-ORG>
I have an experience cloud which is associated my product ‘Abbot’. Abbot has data categories n knowledge articles that populate on experience cloud. Experience cloud uses LWC and aura to populate data categories. Apex is also written to bring the categories on experience cloud site.
Now I want to duplicate this Abbot experience cloud site and make it for my ‘Caspy’ product. Caspy will have different categories and diff KB.
Should i use the same logic as of Abbot which is old way of populating data categories on experience cloud ?
Is there any efficient and latest way to populate data categories on experience cloud?
#Experience Cloud #Lightning Experience #Lightning Web Components #ApexJan 6, 9:13 AM Thanks @avinash for the quick response. But how can i populate the data categories on experience cloud. I am facing this issue. Do you have any tutorial for it?
Hello. Why omniscript reload when the method This.omniNavigateTo() is called from lwc that IS embeded in omniscript?
#Omnistudio #Omni #Vlocity #Vlocity Architects #Salesforce Developer #Salesforce Developers #Developer #Developers #Lightning Web ComponentsDec 23, 2025, 6:42 AM The this.omniNavigateTo() function triggers a page navigation event. When used inside an LWC embedded within an OmniScript, it often bubbles up and causes the entire OmniScript container to refresh or re-initialize, looking like a "reload."
Solution:
Instead of this.omniNavigateTo(), use the
OmniScriptBaseMixin events to communicate with the parent OmniScript without forcing a full page navigation.- If moving to the Next Step:
javascript
this.dispatchEvent(new CustomEvent('omninesxtstep'));
If updating data:
javascript
this.omniApplyCallResp({ "yourData": "value" });
Why it happens: omniNavigateTo is designed for PageReference navigation (like moving from Salesforce Page A to Salesforce Page B). When you call it, the framework assumes you are leaving the current context, so it reloads the component wrapper. Avoid using it for simple step transitions inside the same OmniScript.
Hi I am facing an issue while creating an Movie search app using the APIs.
1.⭐ https://m.media-amazon.com
import { LightningElement } from 'lwc';
const DELAY=300;
export default class MovieSearch extends LightningElement {
selectedType="";
selectedsearch="";
loading=false;
selectedPageNo="1";
delayTimeout;//to store the timeout delay
// search filter for movies .....
get typeoptions(){
return[
{label:"None",value: ""},
{label:"Movie",value: "movie"},
{label:"Series",value: "series"},
{label:"Episode",value: "episode"}
];
}
//here we are destructuring the values....
handleChange(event)
{
let {name,value}=event.target;
this.loading=true;
if(name ==="type")
{
this.selectedType=value;
}
else if(name ==="search")
{
this.selectedsearch=value;
}
else if(name==="pageno")
{
this.selectedPageNo=value;
}
//debouncing process--> where we can delay the execution process for sometime that we want...
clearTimeout(this.delayTimeout)// this will clears the existing timeout...
this.delayTimeout =setTimeout(()=>{
this.searchMovies();
},DELAY);//always define the constants in Capital letters as a best practice.....
}
//this method will search for the entered movies
// here we need to use the fetch method.
// Fetch method always returns the promise .
//to handle the promise we need to uise asyn and await.
async searchMovies()
{
//how to put the url..
// http://www.omdbapi.com/?i=tt3896198&apikey=ac0b1a0e
//const URL='https://www.omdbapi.com/?s=${enteredValue}&type=${this.selectedType}&page=${this.pageNumber}&apikey=ddb0ceaa'---> Api key we need to enter from our mail;
const url=`https://www.omdbapi.com/?s=${this.selectedsearch}&type=${this.selectedType}&page=${this.selectedPageNo}&apikey=ddb0ceaa`;// by using that url we are making API call
const res=await fetch(url);//here we are calling the API
const data=await res.json();//herte we atre storing the response in the property of a data by using the json.
console.log("Movies Search Output",data);
}
}
HTML:
<template>
<!--Filter Section for the movies-->
<div>
<lightning-layout horizontal-align="center">
<lightning-layout-item
padding="around-small"
size="3">
<!--Filter Section==> for the type of movies(movie,series,episode)-->
<lightning-combobox
name="type"
label="Type"
value={selectedType}
placeholder="Select Type"
options={typeoptions}
onchange={handleChange} ></lightning-combobox>
</lightning-layout-item>
<lightning-layout-item
padding="around-small"
size="7">
<!--Filter Section{ by using the name we can search here }-->
<lightning-input
name="enter-search"
label="Enter Search Item"
placeholder="Search for Movie/Series"
type="search"
is-loading={loading}
onchange={handleChange}
></lightning-input>
</lightning-layout-item>
<!--PAge Number Code-->
<lightning-layout-item
padding="around-small"
size="2">
<lightning-input
type="number"
name="pageno"
label="Page"
onchange={handleChange}
value={selectedPageNo}
field-level-help="Range 1-100"
min="1"
max="100"
step="1"
message-when-range-underflow="Minimum value is 1"
message-when-range-overflow="Maximum value is 1">
</lightning-input>
</lightning-layout-item>
</lightning-layout>
</div>
<!--Display Section-->
<div>
</div>
</template> #Salesforce Developer #Lightning Web Components #Lightning Experience #Integration #Salesforce Developer #LWC
Oct 14, 2025, 5:25 PM Great implementation! 👏 The API setup and debounce logic look solid. Just make sure your name attribute in <lightning-input> matches the variable you’re using in handleChange (it should be "search" instead of "enter-search"), which might be causing the update issue.
You can also check out how we handled API-based movie listings on our streaming platform, Vedu Apps — learn more here. It might give you a few ideas for optimizing UI performance and user interaction flow.