New answers tagged

0

You're receiving the error due to the last css block. To resolve the error, you'll need to add .THIS before .comm-page-PAGENAME .cCenterPanel, see below. As for achieving full-width, have you tried overriding the Community's CSS? Original .comm-page-PAGENAME .cCenterPanel { max-width:100% !important; margin:0 } Replace with this .THIS ....


0

We've built a workaround. Namely we catch the error and rewire the data again. Sometimes it is being done 2-3 times but after that everything was loaded and rendered correctly.


1

The critical update applies only if your attributes used in have a function expression $A.createComponent/$A.createComponents Lets say your attribute definition was as below var attributes = { 'chldfield1': field1, 'chldfield2': function (x,y) { console.log('test')}, 'chldfield3': field3 }; The above assumes your component has an attribute of type "...


0

You can use change handler to call the controller there you can refresh the component. <aura:handler name="change" value="{!v.groupnumbers}" action="{!c.yourController}"/>


0

<lightning:recordEditForm aura:id="editForm" Here aura:id is editForm, so, you should use component.find("editForm") instead of component.find("recordForm") handleSubmit : function(component, event, helper) { component.find("editForm").forEach(form => form.submit()); } You should use submit method on form


0

The menu isn't being clipped; it's empty. action requires a typeAttributes where rowActions is a list. This is in the docs: var actions = [ { label: 'Show details', name: 'show_details' }, { label: 'Delete', name: 'delete' } ]; cmp.set('v.mycolumns', [ // Other column data here { type: 'action', typeAttributes: { rowActions: actions, ...


0

THIS is how to do it correctly.... Spent an hour trying to figure it out... <lightning:progressIndicator currentStep="AllDone" type="base" hasError="false" variant="base" > <lightning:progressStep label="Step1" value="Step1"/> <lightning:progressStep label="Step2" value="Step2" /> <lightning:...


2

Added based on comments As a standard you get only 4 values as stated. If you want to render based on custom width/height, you can use media queries The Media Queries Level 4 specification includes some syntax improvements to make media queries using features that have a "range" type, for example width or height, less verbose. Level 4 adds a range context ...


0

So the answer was contained within a comment in this post: Is it possible to return a value from a Lightning Component to a flow? In my Flow, I setup a variable called orderRecords of type record, and checked the Allow multiple values (collection) property. Next, I added a get records element to my flow. Itt retrieves all of the order records with the ...


0

In your recordUpdated handler (loadeventhandler) you need to reload the record manually if(eventParams.changeType === "CHANGED"){ component.find("precord").reloadRecord(); } Here is the related documentation : https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/data_service_handling_record_change.htm


1

That is because you are assigning List<Website_Service__c> to selectServ and when you try to get value on it like selectServ.Name, it will be undefined. You should rather get it from a particular record. I see that you are are fetching single element LIMIT 1. You can use below: selected="{!ans.Name == v.srvList.selectServ[0].Name} This will fetch the ...


0

This issue was acknowledged by Salesforce, and has been resolved now.


0

AFAIK Chrome will grab whatever memory it needs. Just don't have lots of other programs running to avoid thrashing. The Octane score may indicate that the CPU you are using isn't great as it is a JavaScript code execution benchmark. I get an Octane score of 35k on a high-end MacBook Pro. But 24k isn't so far off 30k. I'd try it and see; if it is painfully ...


0

Try deep cloning : JSON.parse(JSON.stringify(response.getReturnValue()));


2

This is because in javascript, if you assign complex (non-primitive) data-types, the assignment is reference types. So, change in copy of data will change the original data also. You can do: Option 1: Spread syntax I guess you are returning list of objects (array), so you can do: component.set("v.pricebookProductsCopy", [...response.getReturnValue()]); ...


1

In lightning component, you cannot assign aura ID a dynamic value. Check this post for more information. You can leverage HTML Data attributes in iteration to keep dynamic IDs or Keys for identification of particular data in the controller using the event from where the element was triggered. Aura Component Snippet <aura:iteration items="{!v....


0

Below is the code snippet const data = ["Vendor Master", "Vendor Master", "Customer Master", "Customer Master", "Customer Master", "Customer Master", "Material Master", "Material Master", "Material Master", "Vendor Master"]; function count(arr) { return arr.reduce((prev, curr) = > (prev[curr] = ++prev[curr] || 1, prev), {}) } console.log(count(data))...


1

I keep the count occurrence in the object, so you can set this object in component with object type attribute. <aura:attribute name="xyz" type= 'Object'/> let count = {}; ["Vendor Master","Vendor Master","Customer Master","Customer Master","Customer Master","Customer Master","Material Master","Material Master","Material Master","Vendor Master"]....


0

I would prefer to use lightning:select. But In your case to get the selected value. <select aura:id="PicklistId"> <option value="" text="- None -"/> <aura:iteration items="{!v.ActList}" var="act"> <option value="{act.Id}" text="{!act.Name}"/> </aura:iteration> </select>...


0

I'm working with Lightning Web Components. Turns out I just needed a plain old <div> tag around the table, and that's it. Theory: Data table needs to live inside of a <div> to figure out its own damn dimensions: <div> <lightning-datatable data={data} columns={RMADetailGridColumns} key-field="Id" hide-checkbox-column sorted-...


0

var selected = Array.prototype.filter.call( component.find("PicklistId").getElement().ActList, function(option) { return act.selected; }).map(function(option) { return act.value; } ); In this chunk of code I don't think act is actually defined. Did you not mean to use option instead as that is the parameter name you ...


0

You're going to want to use aura:unescapedHtml and format your message to use HTML tags rather than newline characters. Something along the following lines: <!-- Success Message Start --> <div class="slds-region_narrow slds-is-relative slds-m-top_small"> <div class="slds-theme_success slds-notify slds-notify_toast"> ...


0

Data Display issue: My issue was that I was referencing a list comprised of two lists so instead of {!wrapper.Name} I needed {!wrapper.event.Name} Aura:Iteration issue: Once I realized the first part I was able to use <aura:if isTrue="{!wrapper.event}"> to check which object type the next value in my list was, and then create the appropriate ...


4

You did not set attribute title in card. If you check docs of lightning:card, title attribute is MANDATORY. <lightning:card footer="Card Footer" title="Hello"> <aura:set attribute="actions"> <lightning:button label="New"/> </aura:set> <p class="slds-p-horizontal_small"> Card Body (custom component) ...


1

In Apex class, you can use Use mrecipient.split(','); which will return list<String> and you can future use to send email. Below is the code snippet: @AuraEnabled public static void sendMailMethod(String mbody, String mrecipient) { List < Messaging.SingleEmailMessage > mails = new List < Messaging.SingleEmailMessage > (); System....


0

You will need to parse the list of Ids while looking for the comma separator to create your list<string> where the string is an Id. I'd recommend using a RegEx function of some kind.


3

You could embed your LWC in a Visualforcepage, and create a VF action instead. For doing so you'd have to embed your LWC in an aura:app —instead of an aura:component. Here's a pseudo-code —you may need to adjust it: The Aura app (myAuraApp) <aura:application access="GLOBAL" extends="ltng:outApp"> <aura:dependency resource="c:myLWC"/> <!--...


0

To prevent the lightning:datatable from resizing, try adding a new CSS property width: 100%; to the enclosing div. Component: <div aura:id="container" class="slds-scrollable_y full-width"> <lightning:datatable keyField="id" data="{! v.data }" rowNumberOffset="0" columns="{! v.columns }" ...


2

You are missing out the send step as mentioned here here. Sends a hit to Google Analytics. The fields that are sent are the values specified in the ...fields parameters and fieldsObject, merged with the fields currently stored on the tracker. here is my sample code of afterScriptLoaded afterScriptLoaded: function (component) { // store the ...


1

Put a <div> tag around your entire component and Add SLDS_Size also remove any width tag from style component.


0

Agreed to Itai's comments on best practice. Adding one other traditional way is to, Convert the image in Base64 format in Base64 and send it across Lightning component/VF and use it. This breaks for very heavy image. Because size of image increases the Base64 text.


0

From what I understand clicking the new button on the related list customObject1 on the Account record - gives you the 'CustomObject1' value in the sObjectType attribute - whereas you want to have 'Account'. For this: You can use "Is Url Addressable" Component to get parent record (Account) details information like Id as you are on detail page of account. ...


0

You need to remove the pre-amble from your base64 string in Javascript i.e. const base64Mark = 'base64,'; const dataStart = base64.indexOf(base64Mark) + base64Mark.length; base64 = base64.substring(dataStart);


3

No. As of today its not available. You can keep checking the documentation Base Components: Aura Vs Lightning Web Components to know: The table lists usage differences between Aura base components and their Lightning web component counterparts.


4

you can get all slds lightning icons SLDS icons. You can enter icon Names with following condition iconType:iconName, Makesusre iconType is in lowercase. Example iconName = 'standard:account' So I add down icon in your code <lightning:helptext content="{!v.text}" iconName="utility:down" class="popover"/>


0

Adding a for loop,for array helped. Thanks everyone. below is the code that worked. var weightage=[]; weightage= component.find("o2cID"); var o2cweightage=100/component.get("v.selectedCountO2C"); //weightage.set("v.value",o2cweightage); if(Array.isArray(weightage)){ console.log('weightage==>'+weightage.length); ...


3

The correct general selector for checkbox checkmark of <lightning:input type="checkbox"/> (where you can redefine its color) is: .THIS .slds-checkbox [type="checkbox"]:checked + .slds-checkbox_faux::after, .THIS .slds-checkbox [type="checkbox"]:checked + .slds-checkbox--faux::after, .THIS .slds-checkbox [type="checkbox"]:checked ~ .slds-...


0

Here's a workaround: var element = document.getElementsByClassName("DESKTOP uiModal forceModal"); element.forEach(function(e, t) { $A.util.addClass(e, 'slds-hide'); });


2

From documentation, If the local ID is unique, find() returns the component If there are multiple components with the same local ID, find() returns an array of the components If there is no matching local ID, find() returns undefined So, you should first check if its array, and if its array you can get length or else you can ...


0

Off hand, I don't know of a way to share a chatter feed with a user who's not subscribed to something without @mentioning them. You could potentially auto-subscribe all of your users to "everything" or at least to particular groups you felt were relevant you wanted to display (unless you want them to follow all records). As I think about this, there is a ...


0

I believe you are simply missing the controller attribute in your component definition... <aura:component implements="forceCommunity:availableForAllPageTypes" access="global"> should be <aura:component controller="WhatsNewListController" implements="forceCommunity:availableForAllPageTypes" access="global"> (or whatever your actual controller ...


0

For the record form, can you try placing the lightning:recordEditForm inside of the lightning:tab rather than how it is right now? Like this: <lightning:tab label="Budget Planner" id="BudgetPlan"> <lightning:recordEditForm objectApiName="Budget_Planner__c" aura:id="budgetPlanner"> . . . . </lightning:recordEditForm> </lightning:...


1

The force:editRecord does not allow you to pre-define any value other recordid of the record to be update. As a workaround:- You can use quick action of type update a record by pre-define a value for the field you are looking for. It will give you the picklist value selected by default when you click on the button. Based on the user interaction with ...


0

String ss='Contact'; //fetch all fields in contact object Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Schema.SObjectType leadSchema = schemaMap.get(ss); List<Schema.SObjectField> fieldMap = leadSchema.getDescribe().fields.getMap().values(); List<String> finalList=new List<String>(); for(Schema.SObjectField ...


0

You can fire navigateToComponent event from Lightning Component. navigateToMyComponent : function(component, event, helper) { var evt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef : "c:myComponent", componentAttributes: { contactName : component.get("v.contact.Name") } }); evt.fire()...


0

You can try onmouseleave Event on the wrapping Div of the Custom Lookup. <div onmouseleave="{!c.onLeave}" And inside the event you can check for the selected value, if undefined show info message and keep the list open. onLeave: function(component,event,helper){ var selRec = component.get(“v.selectedRecord”); //If undefined show some ...


0

As @user57371 said to show the view button on the rows, you need to put the attributes in the typeAttributes object just like the below example. component.set('v.doctablecolumns', [ {label: 'Column1', fieldName: 'Column1'.....}, {label: 'Column2', fieldName: 'Column2'.....}, { label: 'View', type: 'button', initialWidth: ...


0

As JavaScript buttons are not supported in Lightning Experience, A Lightning Component would be ideal for this. Also, not a Visualforce Page because, it is rendered in an Iframe in LEX and you would not be able to interact with the console APIs. Basically you can create: Lightning Component and use the workspace API(to interact with tabs and console) ...


0

As mentioned in your update, these attributes are set using a design file. They are known as Design Attributes as part of the Design Resource in Aura Components: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_app_builder_design_files.htm Also set as Properties under TargetConfig in the meta.xml file of ...


2

The reason it does not change is because you will be getting the parameters from state only on init and initialised only once and whenever you want to load the same component again with different parameters, init will not be invoked again. You should be using change handler on pageReference so that you can get the parameters from state whenever its changed. ...


Top 50 recent answers are included