salesforce-lightning

Showing a loading indicator while calling Apex in Salesforce LWC

折月煮酒 提交于 2020-05-16 06:28:50
问题 What is the best way to show a loading indicator while retrieving data from Apex in a Lightning Web Component? I have this approach: import { LightningElement, api } from "lwc"; import shouldShowCard from "@salesforce/apex/ApexClass.shouldShowCard"; /** * Card component that is conditionally shown based on Apex. */ export default class ConditionalCard extends LightningElement { @api recordId; @api isDone = false; @api shouldShow = false; connectedCallback() { shouldShowCard({ id: this

Shadow DOM not shown in Custom Element with Shadow Root when inspected on Salesforce (Rabbit hole)

主宰稳场 提交于 2019-12-24 07:25:38
问题 I'm trying to understand how Salesforce have implemented their custom lightning component elements. I've read some of the help docs which imply they're following webcomponents standards. When I inspect the page: So this looks like typical DOM structure, but when you go into the console and look into the lightning-icon it says there's no childNodes unless you go into the shadow dom: > document.querySelector('lightning-icon.slds-icon-standard-home').childNodes > NodeList {Symbol(items): Array(0

How to download a report as a CSV directly from Salesforce Lightning?

旧街凉风 提交于 2019-12-02 08:06:20
问题 I am creating a Python script for downloading a report from Salesforce as a CSV. My script is working perfectly fine for Salesforce Classic. However, I need to get it working for Lightning Experience. I'm using the simple-salesforce Python package to access our org. For SF Classic I enter a link that is structured like this: https://my-company.my.salesforce.com/my_report_id?view=d&snip&export=1&enc=UTF-8&xf=csv The script is basically like this: from simple-salesforce import Salesforce import