New answers tagged

0

You can check the following documentation (with sample codes) about using Lightning Design system for other Javascript libraries: Lightning Design System for Angular Lightning Design System for React The above links provide examples about column sorting and you can build up on the examples to add the search feature. Check the Get Started pages for more ...


2

From the documentation of $Organization it's quite clear that possible values are {!$Organization.Id} {!$Organization.Name} {!$Organization.Division} {!$Organization.Street} {!$Organization.City} {!$Organization.State} {!$Organization.PostalCode} {!$Organization.Country} {!$Organization.Fax} {!$Organization.Phone} {!$Organization.GoogleAppsDomain} {!$...


2

if condition should be a comparison. this.template.querySelector('timing').value==="weekly" this.template.querySelector('timing').value==="monthly" It should be === instead of=. Note: = is for assignment, == is for comparison without datatype comparison ("89"==89) and === is for comparison with datatype comparison("89"!=89). Important: Install extensions ...


0

You should not have anything inside body of script if you are giving src. <script type="text/javascript" src="app.js"> App.renderToDOM(document.getElementById('app')); </script> this is wrong. Instead it can be <script type="text/javascript" > App.renderToDOM(document.getElementById('app')); </script> Also what is App here?


0

I would think that the moment you put this in a Lightning component, it gets subjected to Lightning Locker Service which bars inline scripts of this sort. I suppose you could try making it a pre-Locker API version like v39. Alternatively you could possibly do something like... raise a DOM event from the Lightning component indicating that this is a page on ...


0

Have you tried to use ltng:require? Or lightning:container. It depends on what Qualtrics JS snippets should do. Anyway, you can create VisualForce page(Use Visualforce in Lightning Communities), which can have injected java script.


1

As noted in other answers, deleteRecord(recordId: string) accepts only a single record Id. You can handle them together using Promise.all() to handle various scenarios (eg reject when first delete fails, let all complete before handling any resolve/rejects). If you need all-or-nothing semantics then you need to do it in Apex. It's on the backlog (#...


0

There are syntax errors in your code. The corrected version is this: get timing() { return [ { label: 'Weekly', minute: '0', hour: '0', DoM: '*' }, { label: 'Monthly', minute: '0', hour: '0', DoM: '1', month: '*', DoW: '*'}, { label: 'Code' }, ]; } If you’re using VS Code you should have seen red ...


0

The specification of lightning:inputField does not specify required as an attribute. The documentation tab mentions the following: To persist requiredness on a field, select the Required checkbox when defining the custom field in Setup. A required field is displayed with a red asterisk next to the field label. An error message is displayed below a ...


0

You need to remove the Flow footer and create your own navigation. And run this from your JavaScript controller: var navigate = cmp.get("v.navigateFlow"); navigate('FINISH'); // or NEXT


0

lightning:tab by default will load only 1st time when it gets focus - there-by rendering the content/component in its body. Even when you navigate away from that tab, the content will just be hidden but not unrendered. Workaround: aura:if will render/unrender content in it depending on the condition. So use aura:if inside each tab. The condition can be {!v....


0

Using LWC base component (lightning-datatable), you can create custom data type in which you inject your custom component in any column(s). You can create 2/more buttons in it and fire custom events with data and handle them in parent component.


-1

You could overcome this limitation by changing the logic from deleting select records in that data extension to deleting all records from a particular data extension. For this you would need to use a different endpoint: POST /contacts/v1/contacts/actions/delete?type=listReference


0

There are a handful of issues with your code sample that make answering this question difficult. I've copied your code below with several questions. @wire(fetchL2ProductValues,{productId: '$l1SavedValue',userType: '$userType'}) l2ProductList; // This is unnecessary. Use {l2ProductList.data} in the template directly. // get l2ProductOptions() { // return ...


0

You appear to have an extra space in the recordTypeId attribute so that it is "recordTypeId " and not "recordTypeId". That's why it's not recognizing it as a valid parameter.


2

I acutally just wrote an article on this in my brand spanking new blog. Below are the highlights from it as well as a sample taken from my original SFSE post on it. Here are the available Methods: GET DELETE HEAD OPTIONS PATCH POST PUT Here is a working sample (taken from here) <script runat=server> Platform.Load("core", "1.1.1"); var accessToken ...


1

Your apex class has no problem. Import track and your class in LWC js file. Then use below code inside the class: @track apexOptions = []; connectedCallback() { getSchedulableClasses() .then((result) => { console.log('result => ', JSON.stringify(result)); this.apexOptions = result.map((cls) => Object.assign({}, { ...


0

First of all, in <lightning-combobox placeholder="Select Apex Class" options={apexOptions} value={value} onchange={handleApexChange}></lightning-combobox> you should replace the placeholders, e.g. onchange={!c.handleApexChange} (mind the "!c." bit). In JS, you should define an action and enqueue it to retrieve data from database. Cf. https://...


0

i am not finding aura:id declaration for child component(c:FieldsetGenerator) in your parent component code any where. you child component declaration in parent component should be like below. <c:FieldsetGenerator aura:id ='FieldsetGenerator' genericObject="{!v.genericObject}" fieldSetName="{!v.fieldset}" title="Yo" mode="Input"/>


3

jQuery uses normal CSS selectors-like syntax. It doesn't know that "i" is a variable that should be used, nor can it directly know this. Instead, you can use a template string: $(`.dummytableid th:eq(${i})`).css(... Note that we use backtick instead of apostrophe or quotation marks, and the ${variable} notation. This should result in each table being ...


-1

At the end i was missing the change handler for the javascript Here is the new and final javascript and html that works perfectly JS import { LightningElement,wire, api} from 'lwc'; import getClass from "@salesforce/apex/SchedulableClasses.SchedulableClasses"; import setPlan from "@salesforce/apex/Plan.Plan"; export default class ...


2

You can call Apex methods without using the wire service. You just have to call your method defined by the import. Like this : handleClick(){ setPlan({jobName:'Test',d:'0 0 13 * * ?',scheduleName:'PlanTest'}) .then(result => { // code executed if success }) .catch(error => { // code executed if error }); }


0

Looks like you have written doGet method in controller.js instead of helper.js. window.setTimeout( $A.getCallback(function() { console.log('Calling'); that.doGet(component); }), 10000 ); In above code that.doGet(component); will always throw error as that will always undefined in controller.js. Try Change Code ...


0

Alright, I figured it out. I had multiple problems here. The main one being that the DOM wasnt yet fully loaded when the function called. Which still kind of confuses me because window.onload should trigger when the document is ready, no? Cheers


0

you are calling the wrong variable in your setCallback let that = this; let getToolsAction = component.get("c.getTools"); getToolsAction.setCallback(this, function(response) {... $A.enqueueAction(getToolsAction);


1

What you are looking at there is the standard feed publisher component. You cannot manipulate it with JavaScript; Locker Service prohibits you from reaching across namespaces in your JavaScript code. You can change the suite of Quick Actions shown in the default publisher component by editing the Case Page Layout's Lightning and Mobile Quick Actions section ...


1

While Salesforce's naming conventions for Apex are optional in general, this isn't the case with Aura-linked server-side controller methods. I suspect this is due to JavaScript convention expectations (and that many IDEs will whinge if uppercase letters start function names that are not constructor functions [and vice versa]). I can't say that I've seen any ...


0

The data format you're showing is called XML (except you need a root node). What you're really asking is "How do I parse XML strings in Marketing Cloud's Server Side JavaScript". That question has been answered at the following Salesforce StackExchange link. You'll want to surround your string with a root node first. Parse XML in Server Side Javascript


0

split is available, and is the right way to split a string. You have syntax errors in your code. If you are concatenating a string over multiple lines, don't end each line with a semicolon. var a = "qwe" + "rty";


0

We can use below code as well. //get today's date var today = new Date(); var dd = String(today.getDate()).padStart(2, '0'); var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! var yyyy = today.getFullYear(); today = yyyy + '-' + dd + '-' + mm;`


0

I had to introduce a new variable this.l2Result, to prevent the error -"Error: Refresh failed because resolved configuration is not available".The final working code is :- @wire(fetchL2ProductValues,{productId: '$l1SavedValue',userType: '$userType'}) l2ProductValuesCallback(result) { var key,count =0; this.l2Result = result; if (result.data) { ...


1

I think that you can wire a function rather than a var as the result of fetchL2PropertyValues. This means it's basically a callback where you can set values and run your other logic. So you'd write it like: @wire(fetchL2ProductValues,{productId: '$l1SavedValue',userType: '$userType'}) l2ProductValuesCallback({ error, data }) { if (data) { this....


0

Zoomple can be integrated as other JS libraries. There is some issue in image referencing in libraries otherwise it is working as expected. Steps to integrate: Add all js file and images as zip in static resource. Create lighting component using this static resource Code: ZoomComponent.cmp <aura:component > <ltng:require styles="{!...


0

You can use Javascript remoting directly call apex method to get loggedin user details directly from Javascript. Controller public with sharing class MyController { @RemoteAction public static User getLoginUserDetails() { return [SELECT Id, Name FROM User WHERE Id = :UserInfo.getUserId()]; } } Visualforce <apex:page controller="...


0

I haven't tested it but this should work. You didn't share your controller code but you can change the getAccsList method like this: public List<SelectOption> getaccsList() { List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('Account 1','0011t000008jprOAAT')); options.add(new SelectOption('...


0

Okay, so, I was thinking about this and I couldn't find a way to expose a whole Javascript class in another component, but I did come up with a clever little bit of "syntactic sugar" to make it work like we all want. Since the import only allows methods or variables, I simply created a const variable which was an object, whose properties are the class ...


3

LWCs Templates are logicless and don`t support any Expressions anymore (see also here/here) The engine doesn’t allow computed expressions In your case you should either add a new computed property to your items in your assetData at runtime or create a child component (passing the id) which internally uses a getter or tracked variable which builds the ...


2

I'm not sure how sensitive it is but if you're tracking your variable simply changing it should allow for it to rerender. If removing or adding elements isn't enough, you could construct a new array sans the unwanted item and then assign the array to your tracked variable. @track myArray; @track subName; handleClick(event) { let newArray = []; /* ...


1

but child is a Promise No its not - you are assigning the object to your connection property. The actual Promise is on connection.promise. You are resolving later the same object which does not have the fetchRequest method. Change the assignment from connection to connection.promise in your Promise.all and then it should be resolved correctly


0

Visualforce remoting, remoteFunction, are used to call Apex on the Platform. If you wanna call any third party site from javascript then do a normal AJAX call. Also, as it will be a cross-origin request from javascript so make sure the end-server supports CORS from SF domain.


0

Thanks for your help! I have searched for the solution for 2 days (asked multiple people and checked documentation) but couldn't find anything. So I have added an idea for salesforce to provide developers with Accessible Lightning Events from Lightning Page. If you think this Idea can be useful to you as a developer the please upvote. Idea: Accessible ...


0

After a couple of hours - I implemented solution: HTML: <lightning-tree-grid key-field="name" data={treeItems} columns={columns} onrowselection={setSelectedRows} expanded-rows={requestExpandRows} selected-rows={selectedRows}> </lightning-tree-grid> JS file: @api locationId; @api allPO; @...


0

I found a fix, you gotta use a outputLink instead of a commandLink For the commandLink: <apex:commandLink value="{!Order.Name}" onclick="window.top.location='/{!Order.id}';"/> I used this outputLink: <apex:outputLink onclick="window.top.location=('/{!o.id}');" value="/{!o.Id}">{!o.Name}</apex:outputLink> The reason I have onclick is ...


0

Yes, it assigns it automatically to the user that clicks on that record. For example, we have messages that come in. Once a user clicks on that message, the ownership changes to them as a way to "assign" them the message. The flaw is that we have default signatures that are associated with the message that comes in so that it would be Customer Support or ...


0

i used force:inputField for look up inside lightning:recordEditForm but i just tested in standaloneapp only, please try below code and let me know cmp <aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes"> <aura:attribute name="newContact" ...


0

As aura value change handler simply provides old and new value, easy solution is to use onchange action of lightning:input. Component code: <!-- Not needed: <aura:handler name="change" value="{!v.filtreNameText}" action="{!c.filterChange}"/> --> <lightning:input class="CASE" name="input2" value="{!v.filtreNameText}" onchange="{!c....


1

You can try putting target="_blank" property in apex:commandLink. <apex:commandLink value="{!Order.Name}" target="_blank" onclick="window.top.location='/{!Order.id}';"/> You can also try using URLFOR to protect from implementation detail. <apex:commandLink action="{!URLFOR($Action.Order.View, o.Id)}" value="{!o.Name}" target="_blank" />...


3

I think you are not forced to use it if you don't want. The second warning seems like just a good practice information. It reminds you to use .isValid() because you might do something inside the callback that is resource-intensive or difficult to un-do, or something like that. The Trailhead text states that: This function checks that its parent component ...


3

It seems that $A.reportError does a little more than just report the error on the console. It gets the action of the exception, if available, and uses that as description. It will also wrap a non-Aura error, so that required information can be set to the error message. It seems that it will also post the error to the server: Post the action failure to ...


3

You seem to be missing the attribute fields to be passed correctly to the wire adapter getRecord(). The fields attribute expects a field name array. If you used a variable named fields to declare the array, then your code should be written as: const fields = ['Contact.Name', 'Contact.Owner.Name', 'Contact.Owner.FirstName']; ... @wire(getRecord, { recordId: '...


Top 50 recent answers are included