New answers tagged

1

Your code has a number of typos. Notably, JavaScript and Lightning are cAsE-sEnSiTiVe. This means that aura:Handler should be aura:handler, Sortable should be sortable, newDeaths should be NewDeaths, etc. You need to review your code to find any other characters that are incorrect. Check the documentation if you're not sure. You also have some spelling ...


0

Try the metadata in the Custom object itself, it should look like this: <actionOverrides> <actionName>View</actionName> <comment>Action override created by Lightning App Builder during activation.</comment> <content>[Record Pages Name]</content> <formFactor>Large</formFactor> <...


-1

Or either you can drop the quotes "" . Just use if(SFYI == true) it will resolve the above issue. Thanks!!


0

I encountered a similar behavior with the LWC Tree Grid. To solve I simply wrapped that specific code in an if statement that checked the length based on the following console result when unchecking a row: onrowselection={getSelected} getSelected(event) { const selected = event.detail.selectedRows; // prevent execution on uncheck if(selected....


0

The issue is coming from the validateForm function definition. From the controller.js, the validateForm function is called with 3 parameters: helper.validateForm(component,event,helper); But in the helper.js, the validateForm function is accepting only 1 parameter: validateForm: function(component){...} To fix this, change the validateForm function ...


1

Take a look at Business Hours. That's probably something you need. You can find them in Setup -> Business Hours.


1

It's not so obviously on one screen (though you could build something), but they are Business Hours and Holidays. Salesforce provides the ability to calculate times based on these support hours (e.g. "SLA is 20 business hours, when does that elapse given store hours?"), and can be used in Apex as well to support custom code that leverages this information.


0

Saleforce Classic: Go to Setup > Customize > Accounts > Page Layouts.


0

You have to add the External Object to 'Tabs' (Setup->Tabs) and it will be visible for you to be added as a Tab in your application.


1

if SFSY is a checkbox, then you can't compare strings Instead of this if(SFYI == "true") { You should do if (SFYI) { That is the simplest way of checking whether a variable is true or not


0

If your template has a placeholder for search, then you can add the search via navigating to Setup >All Community > Builder > Settings (4th Icon on left) There, expand the theme by clicking setting icons next to the Theme Layout Component and choose the global search component or your custom search component.


0

You can put lightning:layoutItem inside your aura:if to remove empty spaces it will stop creating div unless the condition becomes true <aura:If isTrue="{!itemProduct.PricebookEntries[0].UnitPrice != NULL }"> <lightning:layoutItem padding="around-large" size="12" smallDeviceSize="6" mediumDeviceSize="6" class="layoutItemClass"> <c:...


0

Once you upload the file, you need to refresh the tab by using event="force:refreshView" in cmponent. <aura:handler event="force:refreshView" action="{!c.RefreshTab}"/> In JSController you need to fire this event in order to refresh the tab after your file gets uploaded. action.setCallback(this, function(response) { var state = ...


0

There is no interface to convert a Lead directly through Lightning Components. However you can use your Apex controller for that. Here's the example how to convert Lead programmatically (full reference in Apex Developer Guide: Converting Leads): Lead myLead = new Lead(LastName = 'Fry', Company='Fry And Sons'); insert myLead; Database.LeadConvert lc = new ...


0

The problem is that the outside scope is constantly changing, so only the last value will be used. You can see this behavior in action with this simple script: let x = [1,2,3]; let y; x.forEach(v=>(y=v,setTimeout(()=>console.log(y),100))); You'd see output like this: 3 3 3 Because we only have one y, all of the functions bind to the same variable,...


1

You need to understand the required attribute of the lightning-input-field component. To make an input field required on the server, mark the field Required in Setup. Input fields set as required on the server are universally required, to be displayed with a red asterisk wherever the input fields are used. To make an input field required on the client only, ...


1

In Aura, you can use a Promise to wait for the result. That would look like this: callHelper: function(component,event,helper){ helper.createRecord(component,'dum1') .then(function(result) { console.log(result); }); } createRecord: function(component, recordName) { return new Promise( $A.getCallback(function(resolve, reject) {...


1

Your Apex action is called asynchronously from helper.createRecord(). It does not execute until after createRecord() itself returns, so it's not possible to synchronously return its result value to the calling method, callHelper() - and you certainly wouldn't want the code that's running in your UI to block waiting for an asynchronous function to return, as ...


0

Note that if your Lightning Component is in a Flow Screen, you can retrieve the SessionId using a Flow formula with $Api.Session_ID and then pass it into the lightning component.


2

With Spring '20, you can now set a custom button to Navigate to a Record’s Create Page with Default Field Values You can see this recent question for an example of someone using it as well as the example provided by the release notes below: /lightning/o/Account/new?defaultFieldValues= Name={!URLENCODE(Account.Name)}, OwnerId={!Account.OwnerId}, ...


0

You can do this by adding another <supportedFormFactor type="Small" /> in <supportedFormFactors>:- <?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>42.0</apiVersion> <isExposed>true</isExposed> <masterLabel>Best ...


1

you can do that by adding following css to the top div .fixed{ margin: 0; padding: 0; width: 100%; top: 0; z-index: 101; position: -webkit-sticky; position: sticky; } here is a playground https://developer.salesforce.com/docs/component-library/tools/playground/D9EG6u9FA/7/edit


0

To capture changes to an attribute, use the aura:valueChange handler, whose name is "change": <aura:handler name="change" value="{!v.soqlRequestString}" action="{!c.updateSOQLRequestHandler}" />


2

As sfdcfox already said That border is there to indicate active focus..... but if you still want to remove it assign a class to button icon like this <lightning:buttonIcon iconName="utility:like" variant="bare" alternativeText="Settings" size="medium" class="test" /> then use that class to target during focus css .THIS .test:focus{ box-shadow:...


0

You need to set the value on an object. Here's a self-contained example. Note: setting a value on helper will apply to any and all copies of the component that are in memory. If you need to store the timer on a per-component basis, you need to use an aura:attribute, instead. app <aura:application > <lightning:button label="Toggle" onclick="{!c....


1

Yes, you could do this, you just need to do some CSS positioning: <div class="container"> <aura:if isTrue="{!v.notif}"> <img src="{!$Resource.XfindLogo2Dot}" /> </aura:if> <img src="{!$Resource.XfindLogo2}" /> </div> Then, in your CSS: .THIS div.container { position: relative; } ....


1

I think you are looking for approach to develop this solution. Build An Aura-Component (in the Init Handler, You can call to APex Method, which will check for current logged in UserId by using UserInfo Class and query all accounts owned by this User ) You can then display all these accounts in a lightning datatable Now, go to Object Manager, Button and ...


1

You can just create the component dynamically, that is by using $A.createComponent() method. As per SF doc: The $A.createComponent() and $A.createComponents() methods support both client-side (synchronous) and server-side (asynchronous) component creation. For performance and other reasons, client-side creation is preferred. To use $A....


0

okay, after some snooping, I think I figured out something. just a WARNING, this is undocumented and so utilizing this doesn't guarantee that this will continue to work. I found that there's an undocumented event called "notes:editNote" which expects 4 parameters (at least based on the code, it used getParam() to get these four keywords: noteId, ...


2

The files attribute is the list of files that are uploaded. So you need to concatenate two lists. this.uploadedFiles = this.uploadedFiles.concat(event.detail.files);


3

Because event.detail.files is always a list. Try this instead: this.uploadedFiles = [...this.uploadedFiles, ...event.detail.files];


0

{!URLFOR($Action.CustomObject__c.List, $ObjectType.CustomObject)} should be corrected to {!URLFOR($Action.CustomObject__c.List, $ObjectType.CustomObject__c)} Also, According to docs:- List views are visible to your community users with Customer Community Plus, Partner Community, Lightning Platform Starter, and Lightning Platform Plus licenses, if ...


0

There are three steps to add Aura components to a Visualforce page. Add the Lightning Components for Visualforce JavaScript library to your Visualforce page using the <apex:includeLightning/> component. Create and reference a Lightning app that declares your component dependencies. Write a JavaScript function that creates the component on the page ...


3

You can create one array of javaScript Object like below:- var fieldsArray = [ { type: 'date', number: '1' }, { type: 'text', number: '2' }, { type: 'date', number: '3' }, ] component.set("v.fields",fieldsArray); and then you can iterate over it:- <aura:attribute name="fields" type="...


0

You need to use reportValidity method in lightning:input component. It displays error messages if the input is invalid. Sample code- component markup is having a checkbox field and a button. On button click, the method fired will check the validity of the field. <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:...


1

I face this same error and while debugging a lot i found the issue was in my apex code. My page layout assignment which i queries through tooling api was incorrect. Seems tooling api query doesn't work properly through lightning components. I raised a case to Salesforce for this. Lightning Record edit forms are very strange - This same issue was there in my ...


0

Use Aura attribute to store the resetTime value, you can easily access that from the helper. <aura:attribute name="resetTime" type="Integer" default="30000"/> set that from helper updateRead: function(component, helper) { component.set("v.resetTime", 50000); } get it like this, let time = component.get("v.resetTime");


0

I added below code to store current label of the button that is clicked and sent List of String to Apex instead of String. And it worked for me. handleClick : function (component, event, helper) { var getOnClickEvent = event.getSource(); var ratings = getOnClickEvent.get("v.label"); //or by value getOnClickEvent.get("v.value"); var ...


0

Before tackling the main issue, you need to update your component and use only appropriate interfaces. To make your component available for record pages and any other type of page, implement the flexipage:availableForAllPageTypes interface, likewise, to make your component appear in Experience Builder, it must implement the forceCommunity:...


0

The reason behind you are always ending with else condition is as follows:- As per your definition of attribute:- <aura:attribute name="accFields" type="String[]" default="categoryID__c,ExternalId,categoryName__c,DisplayUrl"/> {!v.accFields.ExternalId} will not hold any value. ExternalId is itself a value of the array. Hence it is not equal to 1. ...


0

I have built the solution for this you can check my article https://salesforcelightningweb.com/#multiple-worksheets-in-excel-using-lwc


1

As mentiined in @Anmol's answer, you should use lightning:combobox or lightning:select. Now, easiest way to add a tooltip to lightning:select is by using its title attribute. e.g. <lightning:select name="select1" label="How many tickets?" required="true" title="this is tooltip!" class="tooltiptext"> <option value="">choose one...</option&...


1

In lightning there is no standard way to display lightning help text along with lightning input fields label as far i know, correct me if I am wrong. So below is the component to add tooltip to ui:inputSelect tag in salesforce. Aura Component <aura:component implements="flexipage:availableForAllPageTypes" access="global"> <label class="slds-...


2

ui:inputSelect is Deprecated as of API version 47.0. Use lightning:select or lightning:combobox instead. Example: <lightning:combobox name="progress" label="Status" value="inProgress" placeholder="Select Progress" options="{! v.options ...


1

What you are trying to achieve needs a bit tweaking :-) Include your italicised or other rich text in attribute in escaped form. e.g. Bold the amount in this label > {'label': 'Open Day &lt;b&gt;($375)&lt;/b&gt;', 'value': 'Open Day'} You would need to use HTML tags <input> and <label> to display your options (please don't ask ...


0

Generally speaking, the data you've returned is already an object/array. The following should work: console.log(enrollmentStatus.data[0].Id); Unless you're using a plain string in the Apex return type, it will already be an object you can use directly.


6

You need to move all the expressions into js. This is done on purpose to make the code more testable as mentioned in documentation Example Html <div class={divClass}></div> JS get divClass() { return this.showleftDiv ? 'slds-size_4-of-6' : 'slds-size_6-of-6'; }


0

Use JSON.parse(). var enrollstatusObj = JSON.parse(enrollstatus); var data = enrollstatusObj.data; var id; var enrollStatus; if (data.length > 0) { id = data[o].Id; enrollStatus = data[0].EnrolStatus__c; }


1

You can parse it as below. As you are sure, the result always will have a single value in the array inside response, You can get the JavaScript array elements using index. this.parsedValue = JSON.parse(enrollstatus); console.log('this.parsedValue ' + this.parsedValue.data[0]); console.log('this.parsedValue ' + this.parsedValue.data[0].Id); console.log('this....


1

You can delete the custom compact layout by using the delete button on the layout page. In your case, You have created a custom compact layout and it can be deleted. Note:-Default compact layout cannot be deleted.


Top 50 recent answers are included