New answers tagged

0

Expressions are not allowed in aura:id. aura:id="{!v.fl.FieldName}" ... defines the ID {!v.fl.FieldName}, not whatever was in the value for FieldName. You must use a hard-coded string. However, this won't help your direct problem. You cannot reach into a component to get its child components. Instead, you can access the attribute Val (assuming it is ...


0

In your code, you have used the aria attribute aria-activedescendant="option1" in the lightning:input element [This instructs the platform about where to place the default focus] <div id="option1" ... inside the aura:iteration element Depending on the search result length, the final rendered HTML markup will have many div elements with id value as ...


1

You can use update screen component for this https://unofficialsf.com/the-update-screen-flow-action-component/ create a lightning component <aura:component implements="lightning:availableForFlowActions,force:hasRecordId" access="global"> <aura:attribute name="recordError" type="String" description="An error message bound ...


3

You shouldn't have to worry about this. In an if/elseif/else chain, only (and exactly) one of the branches will be executed for each record you loop over.


0

As I already had the value from the field itself, but no references (typeOf, instanceOf) using the exclamation mark (not) was possible validating. if(!issueType) { code.. }


0

try this <aura:attribute name="ns" type="String" description="pkg namespace" /> <ltng:require scripts="{! '/resource/<yourfoldername>/' + v.ns + '__' + <your resource name>}" /> Be sure to include any additional folders in the path with the folder name


1

You can use Appexchange Analytics feature for this. You will need to be an ISV application partner with salesforce to get this feature activated. The custom Object Usage log files will have fields for Lightning Components.Filter on custom_entity_type field from the logs. For Technical Details on how to use Appexchange Analytics please check this question.


0

You can solve this today using the Quick Choice extension have your component export a List of Strings and you can then assign that list as one of the inputs to the quick choice component. If you use Automatic Output Handling, you can even do this on the same screen, instantaneously. See https://unofficialsf.com/using-custom-screen-components-with-...


1

You'll probably want to define a custom renderer. Use both afterRender and rerender to make sure you respond to the events that will be called in order to render your charts correctly. Your code would look like: ({ afterRender: function(cmp, helper) { this.superAfterRender(); helper.renderCharts(cmp); }, rerender: function(cmp, ...


2

In JavaScript, you can use the method String.prototype.includes, or String.prototype.match (or several others). String.contains is an Apex method (and Java, and other languages), but JavaScript does not have such a method. Alternatively, you can use a RegExp. includes if(result.getState() === 'SUCCESS' && resultApex.includes('Successfully')) { ...


0

Aside from the possibly missing quote at the end, there's an errant backslash that may screw things up, and you can't use Aura Expressions in dynamic content like this. You should use $A.createComponents and create the content properly: $A.createComponents( [ [ "td", {} ], [ "a", { id: ...


1

In theory, you should be able to use the values stored in the filterList attribute. You just need a few minor adjustments: <lightning:select label="{!val.label}" value="{!val.selectedValue}"><!--GET FROM CUSTOM LABEL--> And: <lightning:input label="{!val.label}" value="{!val.selectedValue}"/> By binding "value" to val, the iterator, ...


0

Please try it in this way. HTML: <div class="slds-scrollable wrapTopics multiSelect"> <lightning:checkboxGroup aura:id="checkbox" name="Checkbox Group" label="Add Topics" options="{! v.topicList }" ...


0

I came to know, salesforce released the new feature in-app guidance which I am exactly looking for. Below is the link. https://help.salesforce.com/articleView?id=customhelp_lexguid.htm&type=5


1

There are two scenarios Communicate with External Frameworks from Lightning: This is very much possible and can easily be achieved by using a lightning-container Lightning-container is a dependency that should be installed npm install lightning-container --save The installed module can be imported for use later import LCC from 'lightning-container'; ...


1

You missed a period to access the function. }).fire();


0

if you are placing it on account page and you need account record id you can declare an attribute recordId and use "force:hasRecordId" interface it will automatically pick like this at the top <aura:component implements="force:lightningQuickAction,flexipage:availableForRecordHome,force:hasRecordId" controller="SK_AccountTreeGridCmpController"> and ...


0

In the column header that is being passed to the lightning data table, include the following (to display a view button in the last column of the row) : {label: 'View', type: 'button', initialWidth: 135, typeAttributes: { label: 'View Details', name: 'view_details', title: 'Click to View Details'}} In the lightning aura component file (HTML), include the ...


0

From the documentation it is clear that it is not supported for Salesforce mobile. In other words its not optimized for mobile. Now that does not mean it will not work. It may work but Salesforce support team won't be able to assist with any support.


1

I tried to use div around the lightning:formattedUrl like you and it worked. Can you show your code? <aura:component > <div> <lightning:formattedUrl class="blackColor" value="www.salesforce.com" /> </div> </aura:component> .THIS .blackColor a{ color: black !important; }


0

The user would a get dismissable popup error (either "Sorry for Interrupting", or "We experienced an error"), or just an error on the console (e.g. in Lightning Out). In any case, you should not do this in production code. However, if you want to make sure you don't "forget" a method while you're developing the code, intentionally leaving it out would give ...


1

You should implement lightningQuickActionWithoutHeader to hide the cancel button Example: <aura:component description="FileUploadPopUp" implements="force:lightningQuickActionWithoutHeader, force:hasRecordId"> <header class="slds-modal__header"> <h2 class="slds-modal__title slds-hyphenate">Modal Header</h2> </header&...


2

Why not target some other class which is not common in both for example in your aura:html tag you can put this <aura:html tag="style"> .cuf-publisherCancelButton{ display:none; } </aura:html>


1

Why are you referencing your updateOwnership js method like this ? <lightning:button variant="brand" label="Take Ownership" onclick="{!comp.updateOwnership}" /> normally js method should be referenced c.updateOwnership. Therefore, I think this is not the origin of your issue. don't you have any other workflow, process builder or trigger firing ...


1

Controller methods are always referred to with c, not any other value. <lightning:button variant="brand" label="Take Ownership" onclick="{!cf.updateOwnership}" /> ... var set_action = comp.get("c.updateOwner"); If this doesn't fix it, there's something else wrong with your code, but I don't see it. You may have a copy-paste error or something else....


0

Make sure you kept all the fields on the layout which you have referred in your lightning component. It was working for me.


1

Are you running into the following error? render threw an error in 'lightning:map' [Cannot read property 'length' of null] Failing descriptor: {markup://lightning:map} If yes, then you need to modify the component HTML as follows: <aura:if isTrue="{!v.mapMarkers.length > 0}"> <lightning:map mapMarkers="{! v.mapMarkers }" ...


-1

Yes, You can achieve it through Lightning Component 'Controller': Collect all the images, make a zip folder. Collect all the images, make a zip folder. Upload it to the static resource. Use Images in dynamic reference. Follow the below controller code : ({ profileUrl: function(component) { var profileUrl1 = $A.get('$Resource.yourGraphics') + '/...


0

The url attributes must be suffixed c__ as per the documentation of lightning:isUrlAddressable


3

For force:refreshView to work, you need to wait until your apex class returns; before this, the changes haven't been committed to the database yet. We use setCallback to accomplish this task. ({ updateCaseClose_helper: function(c, e, h) { var action = c.get("c.updateCheck"); action.setParams({ caseId: c.get("v.recordId") }); action.setCallback(...


1

Modify the helper to pass the parameter from JS to Apex. Helper: ({ updateCaseClose_helper : function(c,e,h) { var save_action = c.get("c.updateCheck"); save_action.setParams({ caseId: c.get('v.recordId') }); save_action.setCallback(this, function(response) { $A.get("e.force:refreshView").fire(); }); $A.enqueueAction(...


0

In my case I want it to take up the entire screen. Considering that the modal of the Quick Action has the following css class: .slds-modal__container { margin: 0 auto; width: 50%; max-width: 40rem; min-width: 20rem; } We can put the spinner component inside a <!-- Loading wheel --> <div class="loading_wheel"> <aura:if ...


0

This is odd, and I had to struggle with this the first time I used the lightning:isUrlAddressable interface. It turns out that the component name and any URL attributes must be prefixed with c__ Your URL should be /lightning/cmp/c__ChageCaseStatus?c__recordId={!Case.Id} or /lightning/cmp/c__ChageCaseStatus


0

Don't think its possible to play around with individual checkboxes in <lightning-checkbox-group> </lightning-checkbox-group>, better to use <lightning-input type="checkbox" checked disabled></lightning-input> As per the documentation Usage Considerations lightning-checkbox-group is useful for grouping a set of checkboxes. If you ...


0

Simple solution: Add them to a list, then join the list. List<String> values = <field>.split( ',' ); String result = String.join( values, ',' );


2

That's basic JavaScript. It doesn't really even matter how many commas are there, 2 or a million. Just replace them all with a single instance: cptCode = cptCode.replace(/,+/g,','); Where /,+/g is a Regular Expression meaning "find a comma (,) followed by any further commas (+), globally within the string (/.../g)." Each match will then be "replaced" with ...


0

First Add lightning:isUrlAddressable interface to the component to which you want to expose it as url and then use below for navigation in calling component Add lightning:navigation aura:id="navService" in cmp file ({ handleClick: function(cmp, event, helper) { var navService = cmp.find("navService"); var pageReference = { ...


0

Try removing $A.get("e.force:refreshView").fire(); and then fire toast and no i dont think you can launch component from button though you can open visual force page from button where you can call your component from there here is the documentation on how you can do that https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/...


1

You also have to set mode="EDIT" for that like this <force:recordData recordId="{!v.recordId}" fields="['CaseNumber','Status']" targetFields="{!v.record}" aura:id="recordData" mode="EDIT" recordUpdated="{!c.recordLoaded}" />


0

Figured it out, I was missing <div class="slds-backdrop slds-backdrop_open"></div> as a sibling of the modal <section> 🤦‍♀️


1

The lightning:fileUpload component takes only one ID but in the handler for onUploadFinished event, you get the Document ID back. You can make another server call to create a new ContentDocumentLink object record. Please note these will be two different transactions so based on the requirement you may need to write your own rollback logic.


1

I deleted cookies from the browser settings. Logged out from salesforce and then logged in. And tried, it displayed correctly. I seriously don't know why. Though it sounds weird, it worked for me. Thanks all, for your time.


0

Also in LWC you can use lightning-formatted-rich-text . For example: <lightning-formatted-rich-text value={label.myLabelWithHTML}></lightning-formatted-rich-text>


0

I've had the same problem with the combo-box and saw this solution for aura component: https://salesforce.stackexchange.com/a/231486/30302 The only thing to change from the original solution is to remove the .THIS part from the css and then it'll work perfectly. Your css should look like this (inside the .css file): .slds-modal__content{ overflow: ...


4

While looks there is no component which is very similar to aura version there is api thats of BETA quality. There is a lightning/uiListApi module to get List views data and metadata in LWC. Note that as of today it is under BETA. There is also a sample code in the trailhead recipe repo import { LightningElement, wire } from 'lwc'; import { getListUi } ...


2

There are several issues here. Logic first: List<String> result = PickListController.getPickListValuesIntoList('Contact', testContact[0].Rol__c); testContact[0].Rol__c is a reference to the content of the Rol__c field, as a string, not the name of the Rol__c field itself. It's passed into getPickListValuesIntoList() as the parameter selectedField,...


1

as said in the error you need to set the 'UiType'(Indicates the user interface where this template is usable) to 'SFX' and 'TemplateType' to custom you can do this onNewEmailTempCreate : function(component, event, helper) { var createAcountContactEvent = $A.get("e.force:createRecord"); createAcountContactEvent.setParams({ "...


0

you can do this though you have to set screen size <a onclick="{!c.clicked}">View Service Request in Siebel</a> js clicked : function(component, event, helper) { window.open('https://www.w3schools.com','newwindow', 'width=3000,height=2500'); }


3

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

I just wrote <aura:attribute name="productCart" type="List" /> instead of <aura:attribute name="productCart" type="Map" />. Problem in type I should have used type="Map".


Top 50 recent answers are included