Quantcast
Channel: Active questions tagged lightning-experience - Salesforce Stack Exchange
Viewing all 3000 articles
Browse latest View live

Aura Attribute access change

$
0
0

We are encountered this issue "You can't set access to 'private' on attributes 'fields' because this component is referenced by Lightning Page: 'Record Page'" when trying to save an aura component with a change to an attribute access (public to private).

We have implemented the interfaces:

  • force:hasRecordId
  • flexipage:availableForRecordHome

How can I change "Today's Tasks" on the Home page to show all tasks?

$
0
0

I can go to the dropdown at the right of the Today's Tasks component and select "My Tasks," but I'd like it to come up automatically. Is this possible ?

Get the image in file - lightning experience

$
0
0

I have to display an image in a lightning component. So in Salesforce classic I put this image in an attachment related to an object, but in lightning experience there is no attachment, or I didn't find them. There is only the possibility to add a file.

My question is how can I retrieve this file in my component ? For an attachment I retrieve the attachment like that :

List<Attachment> img = [select Id, Name, ContentType, parentId from Attachment 
                            where parentId in :listeId and ContentType in ('image/png', 'image/jpeg', 'image/gif')]; 

and in my component I put that :

<img src="{!'/servlet/servlet.FileDownload?file=' + a.image.Id}" alt=""/>

but it doens't retrieve me the url of the image in the file.

Show button on related list tab in Lightning Page Layout instead of dropdown arrow

$
0
0

I've created the Files related list on my Lighting page layout, but instead of the Add Files button, it displays the dropdown arrow. Is there any way I can get it to show the button as it does in the Related tab? I would like it to be as simple as possible for the user. enter image description here

Pagereference not working in Lightning

$
0
0

I have a Detail page button (VF page) and controller for it.

I used Pagereferenc method to take user to the record details page:

However, it works fine in the Classic, but not in Lightning.

    String url = '/'+engCloneCopy.id+'/e?retURL=%2F'+engCloneCopy.id;        
    return new PageReference(url);  

In Lightning, it will open up the edit page correctly, however once user saves the record, then page is blank and record gets updated in the background.

Expectation is that, once user save the record it should go back to the record detail page as it works in classic.

enter image description here Any thoughts?

LWC lightning-card border not shown with slds-card_boundary

$
0
0

Playground example https://developer.salesforce.com/docs/component-library/tools/playground/KLHs3GU9

I have a Lightning Web Component template with a lightning-card in an App Page.

<template>
    <lightning-card title="parent"></lightning-card>
</template>

I would like to nest more cards into it to simulate the related list look and feel from standard Lightning experience.

<template>
    <lightning-card title="parent">
        <lightning-card title="child></lightning-card>    
    </lightning-card>
</template>

This renders the child without borders, filling the entire width of the parent.

If I add the slds-card_boundary class to the child, it draws a misplaced vertical border fragment above and below the card.

However, if I add the slds-card_boundary class to the article element spawned by the child lightning-card component, the border is correctly drawn around the entire card. Adding a slds-m-around_small to article element also forces a separation between parent and child cards.

What layout concepts am I missing with Lightning Web Components to be able to successfully use lightning-card components?

In general, how can lightning-cards be used inside Lightning Web Components to achieve a related list-like appearance?

"Recently viewed" list views

$
0
0

In the Contacts tab, annoyingly, there are 2 standard list views: (1) Recently Viewed and (2) Recently Viewed CONTACTS 🤨. Most of you wouldn't have even noticed this. For list view number (2), can we choose which columns to show? If not, can we hide list view number (2)?

Canvas App not showing in Chatter in Lightning UI

$
0
0

I have created a Canvas App and I have enabled it for everything including Chatter. I am able to preview the Canvas App and it also shows up as a Quick Action. However, while in SF Classic I can see my app in the left hand panel of the Chatter tab I can't see it in the Lightning UI.

Canvas App showing in Classic UI: Classic UI

But not in LEX: Lightning UI

Anyone knows why?


Add grouping record information to report without 'detail rows'

$
0
0

I have a joined report across two Master-Detail relationships to the same master, grouped by Master 1

e.g.

Group     | Master-with-Child-1 | Master-with-Child-2
Master-Id | Sum of Number       | Sum of Number

[ ] Detail rows (off)

This works fine for me, but i want to add some fields of the master record to the same report WITHOUT detailing rows, e.g.

Group     | Master Field    | Master-with-Child-1 | Master-with-Child-2
Master-Id | Text something  | Sum of Number       | Sum of Number

[ ] Detail rows (off)

At the moment, the best i can get is add master field to master-with-child reports and check detail rows which is annoying because i literally have hundreds of Child-1 and Child-2 and all i need is the sum of their number fields.

Hide Standard Page Header in Custom Lightning App page

$
0
0

Is there a way to hide the page header in a custom Lightning App shown below ? This banner is not available in the Edit page section.

I have selected 'One region Template' and added just one Lightning component.

enter image description here

But after saving the header comes by default which I want to remove.

enter image description here

PS: I was able to remove the header by putting the display as none as shown below. But don't know which standard class to refer in css

enter image description here

lightning:recordViewForm and force:recordData refresh issues

$
0
0

I'm having TestObject as parent object and New Custom Object having M-D relationship to it. TestObject having Min and Max Rollup summary fields which will rollup number field in child object.

I was rendering parent information using lightning:recordViewForm And force:recordData date service with certain fields, if we perform any dml in child need to refresh the parent record information.

Here's my Markup code:

<aura:component controller="MyCustomController" access="global">

    <aura:attribute name="records" type="List" access="public" default="[]" />
    <aura:attribute name="fields" type="List" access="public" default="Name,Max__c,Min__c" />

    <aura:attribute name="testObject" type="Map" access="public" default="{}" />
    <aura:attribute name="record" type="Map" access="public"/>

    <aura:attribute name="recordError" type="String" access="public"/>

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

     <div>       
        <lightning:recordViewForm recordId="a0G2800000KJxZp" objectApiName="TestObject__c">
            <lightning:layout class=" slds-wrap custom-layout">
                <lightning:layoutItem size="4" padding="around-small">
                    <lightning:outputField fieldName="Name" class="output-element"/>
                </lightning:layoutItem>
                <lightning:layoutItem size="4" padding="around-small">
                    <lightning:outputField fieldName="Max__c" class="output-element"/>
                </lightning:layoutItem>
                <lightning:layoutItem size="4" padding="around-small">
                    <lightning:outputField fieldName="Min__c" class="output-element"/>
                </lightning:layoutItem>
            </lightning:layout>
        </lightning:recordViewForm>

        <div class="slds-box " style="padding:0px !important;">
            <lightning:button label="Save" variant="brand" onclick="{!c.update}" class="slds-m-right_medium" />
            <table class="slds-table slds-table_bordered slds-table_fixed-layout"> 
                <thead>
                    <tr class="slds-text-title_caps">

                        <th scope="col">
                            <div class="slds-truncate" title="Name">Name</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title="Number">Number</div>
                        </th>
                        <th scope="col">
                            <div class="slds-truncate" title=" Total"> Total</div>
                        </th>
                    </tr>
                </thead>   
                <tbody class="milestone-list"> 
                    <aura:iteration items="{!v.records}" var="record" indexVar="index">
                        <tr> 
                            <td>
                                <div class="slds-truncate">
                                    <ui:inputText value="{!record.Name}" />
                                </div>
                            </td>
                            <td>
                                <div class="slds-truncate">
                                    <ui:inputCurrency value="{!record.Number__c}" />
                                </div>
                            </td>
                            <td>
                                <div class="slds-truncate">
                                    <ui:outputCurrency value="{!record.Number_Sum__c }" />
                                </div>
                            </td>
                        </tr>
                    </aura:iteration>
                </tbody>
            </table>
        </div>
        <force:recordData aura:id="recordData"
                              recordId="a0G2800000KJxZp"
                              fields="{!v.fields}"
                              targetRecord="{!v.record}"
                              targetFields="{!v.testObject}"
                              targetError="{!v.recordError}"
                              mode="EDIT" 
                              recordUpdated="{!c.recordUpdated}"/> 
    </div>

</aura:component>

I'm rendering the child records underneath the recordViewForm, when the child records updated i just want to refresh the parent record details.

Here's my controller code:

update : function(component, event, helper) {

    var action = component.get("c.updateParentValues");
    action.setParams({
        'updateList': component.get("v.records")
    });
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (state === "SUCCESS") {
            component.set("v.records", response.getReturnValue());
            console.log('recordData-->', component.find("recordData"));
            component.find("recordData").reloadRecord();
            console.log('*** refresh is done');
        }

    });
    $A.enqueueAction(action);

},
recordUpdated : function(component, event, helper) {
    var changeType = event.getParams().changeType;
    console.log('**** change type-->', changeType);

    if (changeType === "CHANGED") { 
        component.find("recordData").reloadRecord();
    } 
}

Technically it should reload the record with this statement component.find("recordData").reloadRecord(), but it's not.

enter image description here But in console if i store the value of the data service to the temp variable and ran this temp1.reloadRecord();, now the content is get refreshed. enter image description here

Is there anything i'm missing here. Any ideas or suggestions are greatly appreciated.

Always show more records in Lightning Experience for Related Lists?

$
0
0

In Aloha there was for Related Lists at the bottom a link to always show more records in related lists:

enter image description here

We clicked this ALWAYS and either did it several times or hacked the url like this: rowsperlist=9999999. The result was to see all related records. That was great!

Now in Lightning we see only 4 records at a glance, which is very poor. I did not find a customization to show more:

enter image description here

Question

Is there any way to get make it show more records at a glance without clicking the "View All" Button? Using "View All" is mostly bad for the usability, because the users want to see the list embedded in the context and not separated and isolated in a new view.

Lightning Action to VisualForce Page. Why opens in new Window?

$
0
0

I have lightning action set to open VF page. But not sure why it is opening into new browser window. Is there any hidden configuration? i do not see any navigation rule on Lightning action edit page.

enter image description here

Change the Case tabs to the Subject instead of the Case Number in Lightning(Service Cloud)

$
0
0

Is there anyway to change the Case tab title to the SUBJECT instead of the CASE NUMBER in Lightning(Service Cloud)?

Please see below snapshot. Using Lightning Service Cloud

Your help will be highly appreciated.

Thanks in advance!

(Properly) Link to custom Lightning App from record detail page?

$
0
0

I have a custom lightning app.

How can I link to this app from a record's detail LEX page (e.g. Opportunity) and pass the Opp's ID to it? The end-user is supposed to launch the app and do some additional Opportunity-stuff.

I've tried this so far:

  1. Create a custom button (type = URL). Content:

    {!URLFOR('/c/OppAwesomizer.app?opp=' + Opportunity.Id )}

The button/action shows up on the Opp's detail page (in LEX), but...

So e.g. my Chrome just displays a blank area and the console shows this message:

Uncaught SecurityError: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.

  1. Create a custom action to a LEX-enabled VF page that redirects to the app: Same behaviour as above...

Any help is greatly appreciated, I don't think SF has no way to achieve this but I have not been able to find anything on this...


Getting input field type from lightning:input tag

$
0
0

I want to get input field type information in my lightning javascript controller. How is that possible?

For ex:

<lightning:input type="number" value="{!v.value1}"/>
   <lightning:input type="text" value="{!v.value2}"/>

Is there any work around or method using which i can get whether the field type is 'text' or 'number' in lightning javascript controller?

Thanks

Formula to update a custom field with the number of days at the current opportunity stage

$
0
0

Is it possible to create a formula to update a custom field with the number of days at the current opportunity stage, triggered when the opportunity stage path value is changed?

Aura component does not allow scroll in iOS only on Salesforce 1 mobile app

$
0
0

The aura component shows a list of chat messages. Vertical scrolling does not work in iOS on the Salesforce 1 app. Works fine in Android. I looked at a few other questions like Scroll issue in Salesforce1 | Lightning ui:scrollerWrapper issue but the solutions are not working for me.

My component:

<aura:component implements="force:hasRecordId,force:appHostable,flexipage:availableForAllPageTypes" access="global" controller="TextConversationController">

<aura:attribute name="recordId" type="Id"/>
<aura:attribute name="textMessage" type="String"/>
<aura:attribute name="textMessages" type="String[]"/>
<aura:attribute name="hasUnreadMessages" type="Boolean" default="false" />
<aura:attribute name="markMessagesRead" type="Boolean" default="false" />
<aura:attribute name="CurrentUserDetails" type="User"/>
<aura:attribute name="avatarLink" type="String"/>
<aura:attribute name="dataLoaded" type="boolean" />
<aura:attribute name="Spinner" type="boolean" default="false"/>
<aura:attribute name="isSpinnerRequired" type="boolean" default="false"/>
<aura:attribute name="showMerged" type="boolean" default="false"/>
<aura:attribute name="hasMergedMessages" type="boolean" default="false"/>

<!--aura:handler event="aura:waiting" action="{!c.showSpinner}"/>
<aura:handler event="aura:doneWaiting" action="{!c.hideSpinner}"/-->
<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
<aura:handler name="render" action="{!c.afterRender}" value="{!this}"/>

<aura:registerEvent name="TextConversationUpdated" type="c:TextConversationUpdated"/>

<!-- loading spinner> -->
<aura:if isTrue="{!v.isSpinnerRequired}">
    <div aura:id="spinnerId" class="slds-spinner_container">
        <div class="slds-spinner--brand  slds-spinner slds-spinner--large slds-is-relative" role="alert">
            <span class="slds-assistive-text">Loading</span>
            <div class="slds-spinner__dot-a"></div>
            <div class="slds-spinner__dot-b"></div>
        </div>
    </div>
</aura:if>
<div>
    <ui:scrollerWrapper aura:id="scroll" class="setScrollHeight">
        <section role="log" class="slds-chat">
            <ul class="slds-chat-list">
                <aura:if isTrue="{!not(empty(v.textMessages))}">
                    <aura:iteration items="{!v.textMessages}" var="tm">
                        <aura:if isTrue="{!tm.Direction__c=='Outbound'}">
                            <aura:if isTrue="{!v.showMerged}">
                                <li class="slds-chat-listitem slds-chat-listitem_outbound">
                                <div class="slds-chat-message">
                                    <div class="slds-chat-message__body">
                                        <div class="slds-chat-message__text slds-chat-message__text_outbound slds-float_right">
                                            <span>{!tm.Message__c}</span>                                    
                                        </div>
                                        <aura:if isTrue="{!tm.Direction__c=='Outbound'}">
                                            <br/>
                                        </aura:if>
                                        <div class="slds-chat-message__meta slds-float_right" aria-label="">{!tm.CreatedBy.Name} • <ui:outputDateTime aura:id="oDate" value="{!tm.CreatedDate}" format="MMM d, h:mm a"/>
                                        <aura:if isTrue="{!tm.Merged__c}"> - Merged </aura:if>
                                    </div>
                                        <br/>
                                        <aura:if isTrue="{!tm.Status__c=='Posted'}">
                                            <div class="slds-chat-message__meta slds-float_right"> Sending...<lightning:icon iconName="utility:clock" size="xx-small"/></div>
                                                <aura:set attribute="else">
                                                    <aura:if isTrue="{!tm.Status__c=='Failed'}">
                                                    <div class="slds-chat-message__meta slds-float_right slds-text-color_error">Not Delivered</div>
                                                        </aura:if>
                                                </aura:set>


                                        </aura:if>
                                    </div>
                                    <lightning:avatar src="{!v.avatarLink}" fallbackIconName="standard:user"/>
                                </div>
                            </li>

                            <aura:set attribute="else">
                                <aura:if isTrue="{!tm.Merged__c == false}">
                                    <li class="slds-chat-listitem slds-chat-listitem_outbound">
                                        <div class="slds-chat-message">
                                            <div class="slds-chat-message__body">
                                                <div class="slds-chat-message__text slds-chat-message__text_outbound slds-float_right">
                                                    <span>{!tm.Message__c}</span>                                    
                                                </div>
                                                <aura:if isTrue="{!tm.Direction__c=='Outbound'}">
                                                    <br/>
                                                </aura:if>
                                                <div class="slds-chat-message__meta slds-float_right" aria-label="">{!tm.CreatedBy.Name} • <ui:outputDateTime aura:id="oDate" value="{!tm.CreatedDate}" format="MMM d, h:mm a"/>

                                                </div>
                                                <br/>
                                                <aura:if isTrue="{!tm.Status__c=='Posted'}">
                                                    <div class="slds-chat-message__meta slds-float_right"> Sending...<lightning:icon iconName="utility:clock" size="xx-small"/></div>
                                                        <aura:set attribute="else">
                                                            <aura:if isTrue="{!tm.Status__c=='Failed'}">
                                                            <div class="slds-chat-message__meta slds-float_right slds-text-color_error">Not Delivered</div>
                                                                </aura:if>
                                                        </aura:set>
                                                </aura:if>
                                            </div>
                                            <lightning:avatar src="{!v.avatarLink}" fallbackIconName="standard:user"/>
                                        </div>
                                    </li>
                                </aura:if>
                        </aura:set>
                        </aura:if>
                            <aura:set attribute="else">
                                <aura:if isTrue="{!v.showMerged}">
                                <li class="slds-chat-listitem slds-chat-listitem_inbound">
                                    <div class="slds-chat-message">
                                        <div class="slds-chat-message__body">
                                            <div class="slds-chat-message__text slds-chat-message__text_inbound">
                                                <span>{!tm.Message__c}</span>  
                                            </div>
                                            <div class="slds-chat-message__meta" aria-label="">{!tm.Customer_Interaction__r.Account.FirstName} • <ui:outputDateTime aura:id="oDate" value="{!tm.CreatedDate}" format="MMM d, h:mm a"/>
                                            <aura:if isTrue="{!tm.Merged__c}"> - Merged </aura:if>
                                        </div>
                                        </div>
                                    </div>
                                </li>
                                <aura:set attribute="else">
                                    <aura:if isTrue="{!tm.Merged__c == false}">
                                        <li class="slds-chat-listitem slds-chat-listitem_inbound">
                                            <div class="slds-chat-message">
                                                <div class="slds-chat-message__body">
                                                    <div class="slds-chat-message__text slds-chat-message__text_inbound">
                                                        <span>{!tm.Message__c}</span>  
                                                    </div>
                                                    <div class="slds-chat-message__meta" aria-label="">{!tm.Customer_Interaction__r.Account.FirstName} • <ui:outputDateTime aura:id="oDate" value="{!tm.CreatedDate}" format="MMM d, h:mm a"/>
                                                </div>
                                                </div>
                                            </div>
                                        </li>
                                </aura:if>

                                </aura:set>
                                </aura:if>
                            </aura:set>

                        </aura:if>

                    </aura:iteration>
                    <aura:set attribute="else">
                        <c:CRM_NoDataIllustration message="Looks&nbsp;like&nbsp;you&nbsp;don't&nbsp;have&nbsp;any&nbsp;messages"/>
                    </aura:set>
                </aura:if>
            </ul>
        </section>
    </ui:scrollerWrapper>
    <aura:if isTrue="{!v.hasMergedMessages}">
        <lightning:input type="checkbox" label="Show Merged Texts" name="input1" checked="{!v.showMerged}"/>
    </aura:if>
</div>
</aura:component>

My CSS:

.THIS .slds-chat-message__text{
    width:fit-content;
}
.THIS .setScrollHeight{
    height:250px;
    border-radius: 1px;

}
.THIS .slds-avatar{
    padding-left: 5px;
}

Issue editing agent message using lightning:conversationAgentSend in lightning console

$
0
0

Im trying to get the chat console message using lightning:conversationAgentSend event and im able to get it. The only problem is im not able to edit the agent message. Is it possible to edit the message? If not, is there any possible workaround for it in lightning.

New SLDS class and attribute as of Spring '18 release - no documentation

$
0
0

I've noticed a new SLDS class that is being applied in Lightning Experience. There doesn't seem to be any documentation whatsoever of this class and it's not mentioned in the Spring '18 release part of the Lightning Design System doc.

A border-bottom is now being applied to fields.

.forcePageBlockItemView .slds-form-element_separator {
    border-bottom: 1px solid rgb(221, 219, 218); 
}

My questions are:

1) Where is the comprehensive documentation about the SLDS changes that are being applied per each release? I can't find these anywhere - this is a problem because each release, the styles can change but I don't know the full set of changes that have been made beforehand. There is documentation on new Lightning features but I'm looking at changes to the existing SLDS styling.

2) What is the best way to overwrite this change? It seems I can't overwrite this per se but rather I'd have to go around the houses to overwrite the 'new' task button and have the re-direct point to a Visualforce page with the SLDS tag, and then have the relevant CSS in a static resource style-sheet. Surely there is an easier way?

It seems SLDS users are being forced onto a single set of aesthetics and trying to overwrite this / by-pass this is far too much work and creates issues of its own and isn't best practice.

enter image description hereenter image description here

Viewing all 3000 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>