New answers tagged

1

You can't just get arbitrary data the way you're thinking of. You need to use Lightning Data Service, like this: <aura:attribute name="record" type="Map" default="{}" /> <force:recordData recordId="{!v.recordId}" layoutType="FULL" targetFields="{!v.record}" recordUpdated=...


0

Your ask looks similar to Ideas posted on IdeaExchange. Link: https://trailblazer.salesforce.com/ideaView?id=08730000000BrGCAA0 https://trailblazer.salesforce.com/ideaView?id=08730000000YW3BAAW Similar thread: https://developer.salesforce.com/forums/?id=9060G000000BiS6QAK This Standard button is not available for overriding or replacement or removing as of ...


2

If your goal is to "modify some fields' values using other field values", then you can do this in your onSubmitClicked controller before calling component.find('Form').submit(). If you have values bound to the lightning:inputField (or whatever component) value attribute, you can use component.set() to update the relevant aura:attributes, or if not, ...


0

allow-multiple-sections-open is the tag that simply you can add in the markup


5

Try to change component.set("v.mapList", response.getReturnValue()); component.set("v.initialMapList", response.getReturnValue()); by component.set("v.mapList", response.getReturnValue()); component.set("v.initialMapList", JSON.parse(JSON.stringify(response.getReturnValue()))); If that worked, your problem was that ...


1

you should add the logic to switch the css class from 'slds-hide' to 'slds-show' var spinner = component.find("mySpinner"); $A.util.removeClass(spinner, "slds-hide"); $A.util.addClass(spinner, "slds-show"); To hide the spinner remove 'slds-show' and add 'slds-hide' Read more on lightning:spinner - https://developer.salesforce....


0

You can change the color by following below line of .Cmp and Style file. <lightning:button class="other-devices-button" label="Close" title="Close action"/> Please add space in between .THIS and your class name .other-devices-button .THIS .other-devices-button { background-color: red ; padding: 10px 20px; }


0

As far as I'm aware, the new CSS Style Hooks only work in LWC, not Aura. You'd need to write a custom LWC component to engage with this feature.


2

<aura:if isTrue="{isHover}"> Should be: <aura:if isTrue="{!v.isHover}"> Having errors like this in your code may cause the code not to deploy, or cause unexpected behavior even if it does. Testing this in my org, the output is indeed correct once you fix the merge field. Also, all controller events in Aura always receive ...


0

in CSS add width:100vw (i.e. viewport width) // your modal box will cover the entire backdrop


0

yes you can try this : <lightning:button label="Close" title="Close action" onclick="{! c.closeModalOtherDevices }" class="other-devices-button"/> and go to your css file : .THIS .uiButton.other-devices-button{ background-color: #E6E6FA ; padding: 10px 20px; }


1

To use Font Awesome icons with Aura components: Create the static resource: in Static Resources create a new resource. For example, "FontAwesomeFree", and upload the zip file from Font Awesome. Keep in mind that the maximum file size is 5Mb, so you might have to re-compress it. In the component require the all.css file. You need to specify the ...


0

I meet the same situation as you when I try to refresh something that not display by using lightning:outputfield or lightning:inputfield. Let try my way here: use onload <lightning:recordEditForm onload="{!c.refreshRecord}"> I make a trick that wait for 1s refreshRecord : function (cmp, event, helper) { setTimeout( function () ...


0

Go to Setup > Sharing Setting > Search for object > Click on "New" button > Create a Sharing Rule as Name not equal to '' > Share with Guest User of your community and Save.


2

You can extend datatable and setup event listeners that can then capture a row id. Our team followed this tutorial to get ours working with some minor modifications


0

I found this as resource when you want to preview your VisualForce Page in VsCode: It works for me after following these instructions on the next link. https://medium.com/@idanblich/open-salesforce-pages-and-lex-app-directly-from-vscode-38e889e1759a In the Link you will find instructions to add a tasks.json file in your project. After taking the succesfull ...


1

indexVar can't be used as part of another expression - ie you can't compare it to anything. Because of this, you should use something else as your unique identifier for the row... luckily, you have something - contactId (if you don't have it, you can probably get it easily) So in your button syntax, you would define variant and value like this: <lightning:...


1

It's e.force:navigateToURL, not e.force:navigateToUrl. Make sure you pay attention carefully in JavaScript, as it is cAsE-sEnSiTiVe. If you ever see this, it's because $A.get didn't return an object, which is why the variable was undefined/null.


0

Why don't you use the standard valid rules in object manager? Create a new rule which is true when (issuedDate - Date.today() > 30), and set the error message to "Service To Date cannot be greater than 30 days the current date". That should work well when user subimt the form and got the error message which showed in the lightning-messages part ...


0

I tried the below code and it worked as expected. Include this in the Component(.cmp): <lightning:quickActionAPI aura:id="quickActionAPI"/> Controller code(.js): let actionApi = component.find("quickActionAPI"); actionApi.getSelectedActions().then(function(result){ let actionNameValue = result.actions[0].actionName; //If ...


2

Because these components are XML, you need to escape the & character (this character is used to render unprintable characters, etc). You escape ampersand with &amp;, as in: <c:contactSelect accountId="{!if(v.proposal.CurrencyIsoCode != 'US' &amp;&amp; v.proposal.BillingCountry__c != 'US' &amp;&amp; v.proposal....


5

Salesforce introduces Lightning Messaging Service, which allows communication across Aura, Visualforce, LWC. It's a perfect substitution for Application events and it can be used to communicate between different LWC components. link to documentation about LMS - https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc....


0

Here is a demo for you: actionApi.getSelectedActions().then((selectedActions)=>{ if (selectedActions && selectedActions.length > 0) { selectedActions.forEach(action=>{ console.log(action.Name); }) } }).catch(function(error) { console.log(error); }); Looking at the examples prior to this, selected ...


0

By default SOQL in salesforce return list of SObjects. But when you try to do this : vlocity_ins__CustomerInteraction__c CI = [SELECT Id, vlocity_ins__Status__c FROM vlocity_ins__CustomerInteraction__c WHERE Id = :interactionId]; and when no data is found, it is not able to fetch the first record from the list and it throws an error List has no rows for ...


0

Given no errors occur, both events should fire. I know that I have indeed fired off multiple events in a single function, and both worked as expected. I would recommend using the Salesforce Lightning Inspector to see if the events are logged and their parameters. It's possible that the second component isn't handling the event properly, but without some ...


2

Parent references are not an Array, but a simple Object. No need to use [0]. row.Tasks[0].Owner.Name


2

What you need to do is make sure that you don't attempt to access the approvals list (queryResult) before you actually have it. approvals[0].Id will cause an error, because there is no approvals[0] - so when you attempt to access the Id property of nothing, it causes an error. You will always need to wait for the result, but while you are waiting, you should ...


1

As David said, you need to "flatten" the data. Also, you should not modify the results from getReturnValue directly, as this can cause problems. Always copy the object first. Here's what you'd want to do: var records = data .getReturnValue() .map((row) => ({ ...row, linkName: `/${row.Id}`, ActivitySubject: ...


1

You can't use field paths or expressions in the definition of a Lightning data table like this: fieldName: 'ActivityHistories[0].Subject' As you're doing right now with the linkName field, you'd need to access those data elements and populate them into synthetic fields on the records. You can then access those fields by name.


0

Assuming all of your code functions correctly up to this point, saveDetails needs to return the Id of the newly inserted record. @AuraEnabled public static Id saveDetails(Customer__c regForm1) { try { insert regForm1; return regForm1.Id; } catch(DmlException dmle) { throw new AuraHandledException(dmle.getMessage()); } } ...


0

Use aura:renderIf it will work. No other workaround The difference being that aura:if instantiates the components in both the "if" and "else" attributes, but not both. aura:renderIf instantiates both, then only renders one.


1

Apply z-index css property to section element in your child component as shown below. It should fix your issue. <!-- Modal/Popup Box starts here--> <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria- modal="true" aria-describedby="modal-content-id-1" class="slds-modal ...


0

It may be worth creating a new lightning component that represents a row, then add that component for each line. But if you wanted to handle it all in the parent component, here's how I'd do it: <lightning:select name="{!acqindex}" required="true" onchange="{!c.salesforceObjChange}"> ... </lightning:select> The ...


0

Yes this looks like not supported yet in v50 . I am getting undefined value when trying to access navigator.doNotTrack attribute . I tried to solve this by passing doNotTrack attribute from VF page to LWC component . But that solution does not work if we drag and drop LWC component .


0

You can't override standard functionality like that. There's no injection point for you to add your Lightning component over the standard Save button without you overriding the Edit action and reimplementing the whole page, which is an expensive proposition. The right tool to use to protect data integrity is Validation Rules, alongside marking fields ...


1

I was able to solve this problem by using the uiRecordApi. The documentation around using this can be found here. Salesforce confirmed passing the session id generated from a VF page to your LWC component is a safety risk.


1

from what I understood you want to bind options to variable, you can do this by using component.setReference. From what I remember it'll work like this icmp.setReference('v.options', cmp.getReference('v.myDynamicOptions'))


0

You need to do it like this fr.onload = $A.getCallback(function() { var fileContents = fr.result; var base64Mark = 'base64,'; var dataStart = fileContents.indexOf(base64Mark) + base64Mark.length; fileContents = fileContents.substring(dataStart); self.upload(component, file, fileContents,personelIdentType); };...


1

So, when you use an Aura component fired from a Quick Action, it already puts it in a modal. You can see the standard modal (with a "blank" body) behind your slds modal... Just get rid of the outer HTML elements in your code section, div class="slds-modal__container", div class="slds-backdrop ..." and you should be good to go. ...


0

Got solution for it public class AssignPermissionSetToProfile { @AuraEnabled public static void assignpermi(string profiles,string Sett) { PermissionSet permii=[select id from PermissionSet where Name=:Sett]; List<PermissionSetAssignment> permiList=new List<PermissionSetAssignment>(); List<...


1

I can see that you are not setting the callback for the Apex Action Call. And Also, you are setting the disabled attribute to the wrong element. Use the below code for the JavaScript Controller ({ creategroupbutton : function(component, event, helper) { var action = component.get("c.CreateGroup"); component.set('v.disabled', true); ...


2

To set an attribute on a component, use component.set, not action.set: component.set("v.disabled", true); Note that you haven't set the callback handler, so you have no way to tell if the call failed or not.


0

For videos with their URL on a record you can use Salesforce CRM CMS, just include the video URL in your list View and detail pages. You could also use native CMS for videos not connected to records to list or have individually as well


2

The org edition or sandbox status is not what's determinative here. The key is how your code is installed: whether it is or is not installed as part of a managed package, and if not, whether or not you are in a packaging org. In a context where your code is deployed unmanaged (not as part of a managed package, but simply a source deployment), including the ...


0

There are couple of approaches you can try, You can submit multiple recordEditFroms with one single button by using javascript methods as below:- singleOnSubmitMethod : function(component, event, helper) { component.find('form1').submit(); component.find('form2').submit(); } However this might not work if you hide it inside accordion, not sure if ...


0

A simple approach to validate field validity on lightning:inputField elements is by using built-in Lightning Component methods. Component: <lightning:recordEditForm aura:id="form" objectApiName="Account"> <lightning:inputField aura:id="field&...


0

A simple approach to validate field validity on lightning:inputField elements is by using built-in Lightning Component methods (outlined below). If you need certain behaviors based on specific inputs, the answers above do a good job of going through that. Component: <lightning:recordEditForm aura:id="form" ...


1

This is the model I've found to work: onmouseup : function(cmp, event, helper) { let tab = event.currentTarget.getAttribute('data-tab'); alert(tab); },


4

The Datatable documentation actually has an example specific to sorting you'll find helpful. Taking a quick look, I'd use the parameter in the click event to get the sort direction versus trying to calculate as you've attempted (unless you have some other need I'm not catching). var sortDirection = event.getParam('sortDirection'); component.set("v....


2

The order of initialization is what is causing the issue. With a parent and child aura component, the child aura component actually initializes first before siteId has been passed by the parent. When the component tree is ready, the init event is fired for all the components, starting from the children component and finishing in the parent component. If ...


Top 50 recent answers are included