Skip to main content

#Custom Lightning Component3 diskutieren mit

Hiiiii! 

 

I'm trying to show an agent action's output as a custom UI (tappable buttons) in an Enhanced Chat v2 web deployment, using a Custom Lightning Type. 

 

Setup: an Agent Script-authored Agentforce Service Agent on Messaging for In-App and Web (embedded on a web page). 

 

When a person asks to speak to someone, the agent offers four handoff channels — Live chat, WhatsApp, Phone, Email. Today the options surface as a text list and that works end to end; I want them as clickable buttons, with the tapped option arriving back as the user's reply. 

 

On the live widget, the agent's text arrives but the component never renders.

What's the supported way to render agent-offered options as buttons on this channel, end to end? Specifically - does CLT output rendering on Enhanced Chat v2 work for agents connected through a Messaging channel, or only via the Agentforce Builder "Enhanced Chat v2" connection?

I am having great difficulty getting it to work - all I need is to have the agent surface options as clickable buttons.  

  

Any ideas? 

 

#Agentforce  #Custom Lightning Component  #Salesforce Developer  #Help

1 Antwort
  1. 2. Sept., 15:16

    Hi Megan, good news, your channel is fine: Custom Lightning Types are supported on Enhanced Chat v2 (the web deployment of Messaging for In-App and Web), alongside Lightning Experience and Experience Builder. They are NOT supported on In-App Chat (the mobile SDK), WhatsApp, SMS, Apple Messages, LINE, or BYOC, but plain Enhanced Web Chat is supported. 

     

    Your symptom, text arrives but the component never renders on the live widget, almost always means the renderer is not registered for the enhancedWebChat channel specifically. CLT rendering is channel-scoped: each channel that should render the type needs its own renderer.json in that channel's folder. If your type only has a renderer for the default context (or you were seeing it only in the Builder conversation preview), it renders in preview but stays blank on the live Enhanced Chat v2 widget, which is exactly what you describe. 

     

    So: 

    1. Add and deploy a renderer.json for your Custom Lightning Type under the enhancedWebChat channel folder, not just the default one, pointing at your LWC. 

    2. Redeploy and reload the embedded deployment so the new channel config is picked up. 

    3. For the tapped option arriving back as the user's reply, have the LWC dispatch the selected value as the utterance, that part is on the component, not the channel. 

     

    The Agentforce dev guide 'Enhance the Agent UI with Custom LWCs and Lightning Types' documents the per-channel renderer setup. 

     

    if this helps, please mark it as the Best Answer so it helps the next person, thanks 🙂

0/9000

Hi All,

 

I have a custom lightning component being hosted in a community page.

I was wondering if it would be possible to catch the browser windows close event (beforeUnload) in a lightning component?

This would be useful to both warn the end user and do some data clean up before closing the window.

 

My question is similar to the question being discussed on this topic: https://salesforce.stackexchange.com/questions/244204/does-beforeunload-event-work-in-lightning

 

Thank you for your assistance.

Tiago

3 Kommentare
0/9000

Hi All,

 

I am trying to reduce the amount information visible on my pages and what to try and update my alert notification lightning component from showing multiple with different message but 1 alert banner that displays different information based on the Account ID, here is example of my attempt to use IF statement, but clearly not working;

 

<aura:component implements="flexipage:availableForAllPageTypes" access="global" >

 

    <aura:if isTrue="{!v.Account.ID = '0010C00000DbnUSQAZ'}">

    <div class="slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_warning" role="alert">

         

        <lightning:icon iconName="utility:warning" size="small" class="icn"/>

     

        <div class="slds-p-left_medium"></div>

        <strong>

            <div class="slds-text-heading_medium"><p style="font-weight:bold;"> Test1 </p></div>

        </strong>

        <div class="slds-p-right_medium"></div>

        

       <lightning:icon iconName="utility:clock" size="small" class="icn"/>

            

    </div>

    </aura:if>

   

        <aura:if isTrue="{!v.Account.ID = '0010C00000DbnUcQAJ'}">

        <div class="slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_warning" role="alert">

         

        <lightning:icon iconName="utility:warning" size="small" class="icn"/>

     

        <div class="slds-p-left_medium"></div>

        <strong>

            <div class="slds-text-heading_medium"><p style="font-weight:bold;"> Test2 </p></div>

        </strong>

        <div class="slds-p-right_medium"></div>

        

       <lightning:icon iconName="utility:clock" size="small" class="icn"/>

            

    </div>

    </aura:if>

 

</aura:component>

 

What I want is for an alert that has a single purpose that will dynamically change its message based on the Account ID or Name so I add/remove new one to it to display for very specific accounts and reduce the amount of notification that I have to deal with when editing/creating new pages.

 

Thanks

1 Kommentar
  1. Eric Smith (Retired) Forum Ambassador
    3. Sept. 2020, 12:35

    You could add a Custom Field to the Account object for Alert Text. Then have your component check to see if that field is not empty and display the alert.

    Another option would be to create a Flow that you add to the Record Page that checks for a value in the Alert field and displays a Toast Message (

    https://unofficialsf.com/show-toast-flow-action/) if needed. #LCAnswers
0/9000

Salesforce Flows | Address Verification & Auto-Completion Component!

We've received a number of requests to build an enhanced address entry component for Salesforce Flows into our managed package "AddressTools" - I thought I'd share it with this group as we've found that it's a highly requested feature within our existing user base. I've written an article going over it in more detail. 

https://www.provenworks.com/blog/post.php?s=2020-07-29-address-verification-in-salesforce-flow-screens-for-auto-completing-addresses

0/9000

Hi Team,

 

We have a custom lightning component(aura) in our application to create a new record in custom object A, this object having lookup relationship with another custom object B.

 

Before summer'20 release our users go to the component and create new record in object A, and in the lookup they search and map B object records using lookup. if the records are not available in object B, they were able to create it using quick create option. 

 

But after summer'20 release, this quick create option is not visible when you search records in lookup field in our custom component.

 

So is there any changes happened in aura components with regards to quick create option.

 

Show quick create - option is enabled in setup - user interface settings.

2 Kommentare
  1. 20. Juli 2020, 16:13
    Hi @Elna Miller

    thanks for your response.

    I raised a salesforce case and come to know that LIghtning:input field will no longer support drop down create option in look up field.

0/9000

Hello everyone!

I need help with a problem that I have. 

I have two sandbox with the same lightning component and the same code,I compare with clickdeploy.io, BUT, In one sandbox is working fine when doInit initialize, but in the other sandbox is not working. There are two components related, the parent component and the child. The parent component doInit method is working fine, but the child component is not working, It doesn't even run the doInit of the child component. This causes the functionality does not load correctly. The strange thing is that in one sandbox it works correctly but in the other it doesn't, even though it has the same code and components.

 

Code of sandbox 1

 

Cmp

 

<aura:component implements="lightning:actionOverride,force:lightningQuickAction,force:hasRecordId,flexipage:availableForAllPageTypes" controller="OM_ActionPlanTemplateCreationController">

    <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> 

    <aura:attribute name="taskdependencyList" type="String[]"/>

    <aura:attribute name="TemplateID" type="String"/>

    <aura:attribute name="aptwrapper" type="OM_APT_TaskTemplate__c[]" />   

    <aura:attribute name="apt" type="OM_Action_Plan_Template__c" default="{'sobject':'OM_Action_Plan_Template__c'}"/> 

    <aura:handler name="deleteRowEvent" event="c:OM_DeleteRowEvent" action="{!c.removeRows}"/>

 

...... More code

 

                        <tbody>

                            <aura:iteration items="{!v.aptwrapper}" var="item" indexVar="index">

                                <c:OM_APTRowItem Apt="{!item}" AptTemplate="{!v.aptwrapper}" rowIndex="{!index}" taskId="{!item.id}" TemplateID="{!v.TemplateID}"/>

                            </aura:iteration>                                           

                        </tbody>

 

Code of sandbox 2

 

<aura:component implements="lightning:actionOverride,force:lightningQuickAction,force:hasRecordId,flexipage:availableForAllPageTypes" controller="OM_ActionPlanTemplateCreationController">

    <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> 

    <aura:attribute name="taskdependencyList" type="String[]"/>

    <aura:attribute name="TemplateID" type="String"/>

    <aura:attribute name="aptwrapper" type="OM_APT_TaskTemplate__c[]" />   

    <aura:attribute name="apt" type="OM_Action_Plan_Template__c" default="{'sobject':'OM_Action_Plan_Template__c'}"/> 

    <aura:handler name="deleteRowEvent" event="c:OM_DeleteRowEvent" action="{!c.removeRows}"/>

    

...... More code

 

                        <tbody>

                            <aura:iteration items="{!v.aptwrapper}" var="item" indexVar="index">

                                <c:OM_APTRowItem Apt="{!item}" AptTemplate="{!v.aptwrapper}" rowIndex="{!index}" taskId="{!item.id}" TemplateID="{!v.TemplateID}"/>

                            </aura:iteration>                                           

                        </tbody>

 

The problem is when aura:iteration call other component, in the sandbox 2 does not load and sandbox 1 does load. If someone has happened I appreciate the support or if you have any idea how to solve this problem.

 

I am attaching the screenshot of each sandbox.

 

Thank you

0/9000

I am trying to open a group page from a custom lightning component in a customer community that I am building and the the chatter for that group is empty. Researched and found that this is a know issue (link below) in Salesforce. Is there a workaround for this issue that people have implemented ?

Chatter renders empty

0/9000

Hi- I am trying to use a custom svg icon in lightning component with Workspace API. I have to use the Icon in setTabIcon of workspace API. According to the documentation it accepts the "SLDS Icon Keys", so does that mean we cannot use custom icons from static resource. And if it is possible to use icons from static resource in Javascript then please let me know how.

 

This is what I am trying to achieve:  

workspaceAPI.setTabIcon({ tabId: focusedTabId, icon: "Icon from Static Resource" });

1 Kommentar
0/9000

Does anyone try to track the number of clicks in button (which is a custom lightning component) using google analytics?

 

We are using google analytics but it can only track page views.

2 Kommentare
  1. 24. Okt. 2019, 16:07
    Laurel is correct. You can use Google Analytics to add event tracking on your buttons directly. Or if you use Google Tag Manager you can set up event tracking on all button clicks, assigning them a name and even a conversion value if you want. Here's a resource: https://salesforce.stackexchange.com/questions/189862/how-to-use-google-analytics-for-lightning-component-controls-events

    It's not exactly what you're looking for but it points to the right direction. I recommend tracking them as events and not pageviews though.

0/9000

We have a custom lightning component where a user would choose one of 5 objects. Then there is a search box where the user searches for the records and can add multiple records. while displaying multiple records from search result we are using lightning recordview control because we want to show compact layout on the search. results are retrieved. we can able to save form but getting below warning message. 

This page has an error. You might just need to refresh it. [PromiseRejection: [Assert Violation: [object:vm undefined (505)] must be inserted.]]. This seems to be known issue if there is a huge data across the object

@Charles Cummings 

0/9000