I have overridden standard 'Add Products' button of OpportunityLineItem object with a VF page. It was working fine in classic and Lightning both before Spring'18 release. But after Spring'18 release it is working only on classic. In lightning it is redirecting to the standard detail page of opportunity. Is this any issue with Spring'18 release or am I missing some settings for button override.
Standard button overrides not working in lightning after Spring'18 release
Migrating Custom list button with javascript content source to lightning experience
I have an object say childObj__c. I have a visualforce page for the parent account object with a standard controller.On this VF page, I have a related list of this childObj__c using :
<apex:relatedList list="childObj__r" />.
Also for this childObj__c I have a custom list button 'New' with content source as javascript. Thereby using the merge field we are checking for some account field and based on some condition we are redirecting to another VF page for creating a new record or showing an alert error message.
But this button is not visible is the lighting experience as it is javascript button and also a list button.
To make this work, I thought of creating a new button overridden with the VF page having a standard controller for childObj__c. But how can I access the account field there to conditionally redirect to another vf page.
Update: I tried creating new custom button with VF page overriden, but we cannot add it in the related list of parent account object as its not a list button.
Hide convert button with lightning component hack
One function we would love is to not show the convert button on the lead unless it's the right time to convert (ie. the correct stage with all data gathered).
I have created a Lightning component which can easily modify the CSS of the lead page. However, I am struggling implementing the JS side which I want to find the Convert button and hide it.
this works in Jfiddle and browser extensions, but not in salesforce itself. Something is getting in the way. Any ideas?
function HideConvert() { var elements = document.querySelectorAll('[title=\"Convert\"'); for (var i = 0; i < elements.length; i++) { elements[i].style.display = "none"; }}
Related Articles list is not visible for guest user
I am using Related Articles list component in Napili community. It is visible only for logged user. The component is not visible for not-logged-in user.
Edit: Also, the issue seems to be with Trending Articles, Trending articles shown to logged in user are different from what it is showing to Guest user.
Guest user has Read Access to all article types.
Using existing VF page in Lightning experience
We need to use existing VF pages in lightning experiences. We changed the styling using standard attribute lightningStylesheets="true".
But apex:pageMessages seems to be not working on those VF pages.Can we do something for this? Otherwise we need to remove apex:pagemessages from all our pages and use some other way to display errors.
Lightning Experience: How to prevent Quick Action opening two times?
In SF Lightning Experience I have a custom Quick Action for Account object which opens my custom Lightning component in the quick action popup.
The problem is that when I click two times on the quick action button I get two popups opened one above another. When user is finished working with the higher popup and closes it - all of a sudden he sees another one (that was opened first)
Is there a way to prevent such double opening of the quick action?
Vf Page on lightning home page giving error
I have created a VF page to display Feeds on lightning home page.
<apex:page showHeader="false" sidebar="false"><chatter:feed entityId="{!$User.Id}"/></apex:page>
this page is enabled for lightning. When I log in as admin I am not getting any error.But I have a custom profile assigned to the user. I have enabled Vf page to this user.
But when I login as this user I am getting an error for this page.Error is
"The page no longer exists. Try reloading it. If the problem persists, contact Salesforce support."
How should I resolve this, I have given permission to this page then too I am getting an error.
Send Email quick action on Contact
I am trying to configure send Email quick action on Contact object. Although I have set the deliverability to the All emails and enable email-to-cases, it's not showing up on the page. Why it is not showing in the record page although I added it to the page layout?
2GP: Filtered report charts in Lightning Record Pages can't be packaged and working
In a 2nd generation managed Package, I want to include Filtered report charts in Lightning Record Pages, but I either can't package them because the filter is namespaced, or the filter is broken in the subscriber org because the namespace is missing.
Does anybody know a workaroud? Or if it is documented behavior?
Error message when packaging with namespace:
Account_Special_Datensatzseite: Component [flexipage:reportChart] attribute [reportFilter]: Unknown Filter: namespace__fieldname__c.namespace__Account__c.Id
How to reproduce:
- Create a project with namespace in dx
- Create a scratch org with this namespace
- Create a report on Opportunities and include the account information so you can filter on this
- Add this report to the Account Lightning Record Page
- Pull the metadata with dx
- Create a new package (2GP)
- Create a new package version -> this will fail
- Remove the namespacing from the flexipage:reportChart component in the metadata of the Lightning Record Page
- Create a new package version -> this will be successful
- Install the package to another org (without the previous namespace)
- Go to the Account and Activate the Lightning Record Page from the package
- You will get the following error
Account Name is not visible in the Approval Process record?
Download data as Excel File in Aura Component
I have a Lightning Component that renders data in a table. I currently have the logic that downloads as a CSV file. For some users,Excel is not auto formatting the file to display as Columns. So they want the file to be downloaded as an Xls or Xlsx file. I have done some research to see if there is a solution for downloading as an excel file on the client side itself but I couldn't find any. The logic that I currently have is below :
csvSample.cmp
<aura:component controller="csvDownloadCtrl"> <aura:handler name="init" value="{!this}" action="{!c.loadContactList}"/> <aura:attribute name="ListOfContact" type="contact[]"/> <div class="slds-m-around--xx-large"> <button class="slds-button slds-button--brand" onclick="{!c.downloadCsv}">Download As CSV</button> <br/><br/><table class="slds-table slds-table--bordered slds-table--cell-buffer"><thead><tr class="slds-text-title--caps"><th class="slds-is-sortable slds-text-title--caps" scope="col"><span class="slds-truncate" title="Name">First Name</span> </th><th class="slds-is-sortable slds-text-title--caps" scope="col"><span class="slds-truncate" title="Last Name">Last Name</span></th><th class="slds-is-sortable slds-text-title--caps" scope="col"><span class="slds-truncate" title="Department">Department</span></th><th scope="col"><div class="slds-truncate" title="MobilePhone">Mobile Phone</div></th></tr></thead><!--table body start, Iterate contact list as a <tr> --><tbody><aura:iteration items="{!v.ListOfContact}" var="con"> <tr><th scope="row"><div class="slds-truncate" title="{!con.FirstName}">{!con.FirstName}</div></th><th scope="row"><div class="slds-truncate" title="{!con.LastName}">{!con.LastName}</div></th><th scope="row"><div class="slds-truncate" title="{!con.Department}">{!con.Department}</div></th><th scope="row"><div class="slds-truncate" title="{!con.MobilePhone}">{!con.MobilePhone}</div></th> </tr></aura:iteration></tbody></table> </div></aura:component>
csvSampleController.js:
({ loadContactList: function(component, event, helper){ helper.onLoad(component, event); }, downloadCsv : function(component,event,helper){ var stockData = component.get("v.ListOfContact"); var csv = helper.convertArrayOfObjectsToCSV(component,stockData); if (csv == null){return;} var hiddenElement = document.createElement('a'); hiddenElement.href = 'data:text/csv;charset=utf-8,'+ encodeURI(csv); hiddenElement.target = '_self'; hiddenElement.download = 'ExportData.csv'; document.body.appendChild(hiddenElement); hiddenElement.click(); }, })
csvSampleHelper.js:
({ onLoad: function(component, event) { var action = component.get('c.fetchContact'); action.setCallback(this, function(response){ var state = response.getState(); if (state === "SUCCESS") { component.set('v.ListOfContact', response.getReturnValue()); } }); $A.enqueueAction(action); }, convertArrayOfObjectsToCSV : function(component,objectRecords){ var csvStringResult, counter, keys, columnDivider, lineDivider; if (objectRecords == null || !objectRecords.length) { return null; } columnDivider = ','; lineDivider = '\n'; keys = ['FirstName','LastName','Department','MobilePhone','Id' ]; csvStringResult = ''; csvStringResult += keys.join(columnDivider); csvStringResult += lineDivider; for(var i=0; i < objectRecords.length; i++){ counter = 0; for(var sTempkey in keys) { var skey = keys[sTempkey] ; if(counter > 0){ csvStringResult += columnDivider; } csvStringResult += '"'+ objectRecords[i][skey]+'"'; counter++; } csvStringResult += lineDivider; } return csvStringResult; },})
csvDownloadCtrl.apxc :
public class csvDownloadCtrl {@AuraEnabled public static list <contact> fetchContact(){ List <contact> returnConList = new List < contact > (); for(contact con: [SELECT firstName, LastName, Department, MobilePhone From contact LIMIT 1000]) { returnConList.add(con); } return returnConList; }}
PS : The data that is being downloaded is a list of Wrapper object. For keeping things simple I have added the Apex controller to return list of contacts. Also the use can filter the data on the component, So I have to download the data that is available on the Component after filtering.
Any help is greatly appreciated. Thanks
Only "Recently Viewed" option is showing in lightning experience. All options is not visible
When I am in lightning experience I see that only "Recently Viewed" view option is showing up and it is in readonly state. There is no way to select the "All" view option.
I am noticing this for all objects like Account, Contact, Lead, Product etc.
Attaching a screen shot for reference.
Could you please suggest any solution how to fix it?
Thanks,Bikram.
Fields are missing in Lightning Experience for Tasks/Log a Call/Events. Any workaround for this?
My question could be a duplicate of the below question that was not answered.
Email and Phone Task fields are missing in lightning experience
Just added a custom field in Activity object using Salesforce classic. Standard Comments and the custom field meant to be available on Task layout.
I switched back to Lightning Experience and tried to verify it. But, I have not found those two fields (the standard Comments field and the custom field which I have created).
Please guide me on how to bring those two fields in Lightning Experience. Thanks.
Unable to access Salesforce Lightning Experience in Microsoft Edge Browser
Today I am facing a very weird situation when I log in using Microsoft Edge Browser.Then I am unable to open any settings in Salesforce Lightning Experience.But it is working fine in another browser, can you please provide me the solutions to fix this isse=ue.I believe I need to fix some settings in the MS Edge browser.
Please find the Error steps below, thanks in advance.
Not showing mail content in a email notification
I'm new to SalesForce and has a question regarding the Service / Case management and notifications to the case owner.
If one is using the email to case and there is a communication via e-mail between the customer, the agent get a notification when the case is updated (the customer has sent a mail).Can one configure the notification not to show the mail from the customer (and agent)? Eg the case notification is only to contain that the case has been updated.This is keep data so SalesForce and not send sensitive information sent in the mail from the customer our to the agents mailboxes.
I've been told that one can't choose not to include the mail content in the notification e-mail, which is not good in terms of Information Security and Data Protection as you loose control over the customer's mail when it is send to the agents mailbox.
You have to turn e-mail notification off entirely, which is not good in term of user experience.
How to show a hyperlink in error message in lightning?
How to remove error messages from lightning:input?
I Created a component which consists of a form with a group of fields.The form contains 5 fields. Out of 5 fields, 4 are mandatory.If the user clicks on the save button without entering data into the required fields, it is showing error messages.Now, if I click on the cancel button, all error messages should be removed.
Component:
<aura:component implements="force:appHostable,forceCommunity:availableForAllPageTypes" access="global"><aura:attribute name="isVisible" type="String" default="0"/><div class="{!v.isVisible == '1' ? 'slds-show' : 'slds-hide'}" style="height: 640px;"><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 ipad-height"><header class="slds-modal__header" style="background: rgb(255, 14, 73);color: #FFFFFF;padding: 1rem"><button style="top: -2rem;font-size: 20px;" class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" title="Close" onclick="{!c.cancel}">X</button><h2 id="modal-heading-01" class="slds-text-heading_medium">COMPUTERS SERVERS AND WORKSTATIONS ISSUE FORM</h2></header><div class="slds-modal__content slds-p-around_medium"><lightning:layoutItem ><lightning:input class="formitem" aura:id="sw-f1-req" type="text" name="Franchisee Name" label="Franchisee Name" required="true"/> </lightning:layoutItem><lightning:layoutItem ><lightning:select class="formitem" aura:id="sw-f1-req" name="select1" label="Best Way to Reach you" required="true"><option value="">select one option</option><option value="1">Home Phone</option><option value="2">Mobile Phone</option><option value="3">Work Phone</option><option value="4">Email</option></lightning:select></lightning:layoutItem><lightning:layoutItem ><lightning:select class="formitem" aura:id="sw-f1-req" name="select2" label="Please Select Your Location Center" required="true"><option value="">select the center</option><option value="1">Center1</option><option value="2">Center2</option><option value="3">Center3</option><option value="4">Center4</option></lightning:select></lightning:layoutItem><lightning:layoutItem ><lightning:select class="formitem" name="select3" aura:id="sw-f1-req" label="What computer are you experiencing trouble with?" required="true"><option value="">select the computer</option><option value="1">C1</option><option value="2">C2</option><option value="3">C3</option><option value="4">C4</option></lightning:select></lightning:layoutItem><lightning:layoutItem ><lightning:textarea class="formitem" name="myTextArea" value="Enter the details of the issue" label="Please give a detailed description of the issue you are receiving" /></lightning:layoutItem></div><footer class="slds-modal__footer"><button style="background-color: rgb(255, 14, 73);color: #FFFFFF" class="slds-button slds-button_neutral" onclick="{!c.save1}">SUBMIT</button><button style="background-color: rgb(255, 14, 73);color: #FFFFFF" class="slds-button slds-button_neutral" onclick="{!c.cancel}">CANCEL</button></footer></div></section><div class="slds-backdrop slds-backdrop_open" style="background-size:cover;background-image: url('http://www.waxcenter.com/images/background-reservation.jpg')"></div></div>
JS Controller:
({save1 : function(component, event, helper) { var allValid = component.find('sw-f1-req').reduce(function (validSoFar, inputCmp) { inputCmp.showHelpMessageIfInvalid(); return validSoFar && !inputCmp.get('v.validity').valueMissing; }, true); if(allValid) { //invoke apex controller }},cancel : function(component, event, helper) { component.set('v.isVisible','0');}})
Please help me to resolve it.
Unable to see Open Activities and Activity History related list in lightning mode
In managed package's object I am unable to view Open Activities and Activity History related list in lightning mode. But visible in classic view.It is present in layout.Still unable to view.Can someone please help?
When Navigating to a standard record page from a lightning web component the related list on the record page has not been updated [duplicate]
I use a lighting web component to create multiple related records linked to a parent record. After this is completed I use the NavigationMixin to redirect back to the parent record. I am successfully redirected but the related list does not show the newly created records and I need to refresh the page again before they appear.
Is there anyway I can force the page to be refreshed or to display these new related records when I am initially redirected? Below is the sample code of the final redirect
navigateToParentRecord(){ this[NavigationMixin.Navigate]({ type: 'standard__recordPage', attributes: { recordId: this.recordId, actionName: 'view' } });}
Thanks
connectedcallback vs renderedcallback in lightning web component
I'm new to Salesforce LWC. I'm trying to understand the LWC component life cycle methods. But it is a bit difficult to understand. Can any give a simple explanation about connectedcallback() and renderedcallback() methods with simple example in LWC?