Skip to main content
Group

Lightning Web Components

Group for discussing Lightning Web Component. Good place to post doubts, suggest best practice, standards and so on.

Hi,

 

I have created a custom LWC component in English language and added this component in a 2nd generation managed package. Component is working fine in English language but my requirement is to show a LWC component which support multiple language when a user views it. When a user installs my package and see the components, then it should be visible in user's language which can be any language other than English.

 

For example - if a French native language user sees the component, the component's html content should be visible in French language instead of English language.

 

Does anybody knows how to allow multi-language support in LWC? Please suggest something. Thanks in advance.

 

@Lightning Web Components

2 answers
0/9000

Hello Everyone! I'm having an issue with Record Edit Forms when using them to create a record.

 

We have an sObject where we are using a LWC as the overloaded 'New' button. Since Input Fields don't allow us to create related records in line like we can in the Native Salesforce experience I've gone ahead and created a custom lookup component with that 'Create New Record' button that will open up a modal and based on the object's schema build a form from the fields on the page layout. 

 

This was working great for a while, but recently we have been seeing a component error crop up that looks like this: 

 

[NoErrorObjectAvailable] Script error.

a()@https://static.lightning.force.com/cs92/auraFW/javascript/Q8onN6EmJyGRC51_NSPc2A/aura_prod.js:955:196

{anonymous}()@https://static.lightning.force.com/cs92/auraFW/javascript/Q8onN6EmJyGRC51_NSPc2A/aura_prod.js:955:389

dispatchEvent()@https://static.lightning.force.com/cs92/auraFW/javascript/Q8onN6EmJyGRC51_NSPc2A/aura_prod.js:12:33511

I.dispatchEvent()@https://static.lightning.force.com/cs92/auraFW/javascript/Q8onN6EmJyGRC51_NSPc2A/aura_prod.js:12:7816

o.createOrSaveRecord.then._pendingAction()@https://java-customer-5018-dev-ed.lightning.force.com/components/interop/recordEditForm.js:1:7223

 

The record is successfully created and the rest of our code runs to completion, but this annoying grey popup still shows up. 

 

I've stripped this component down to it's bare roots (Just the record edit form) without any custom functions and I'm still having the same results. You can see the Stripped version below.

 

<lightning-record-edit-form object-api-name="Account">

     <lightning-input-field field-name="LastName"></lightning-input-field>

     <lightning-button type="submit" label="submit"></lightning-button>

</lightning-record-edit-form>

 

My THOUGHTS are that this error is happening in Salesforce' managed code and it is presenting itself due to the fact that we are creating records on a record create page for a completely different sObject.

 

One final note, I've tried using the Record Form component have have had success. The only reason I want to use the Record Edit Form is it will respect the page sections. 

 

Thanks! 

2 comments
  1. Aug 26, 2025, 10:48 PM

    Our issue is likely nowhere near related to the OP's, but for future travelers who happen upon this question in a desperate grasp at straws (like I did): 

     

    We have custom LWCs embedded in a custom Aura component that (in some sandboxes) suddenly had Component Errors that look a lot like the OP's. 

     

    After much weeping and gnashing of teeth, we discovered that Salesforce had gone into our Session Settings and checked "Enable Content Delivery Network (CDN) for Lightning Component framework." Upon disabling (unchecking), the Component Error went away. 

     

    Knowledge Article 005115596 (

    https://help.salesforce.com/s/articleView?id=005115596&type=1

    ), titled, "Salesforce Lightning CDN Preference Auto Enablement" and which as of this writing is showing published 31 July 2025, states, "As this only impacts Salesforce owned content, we are enabling the org preference to be ON for customers that have the preference set to OFF. There is no required action that needs to be taken as this will be enabled by Salesforce." 

     

    I filed a Support Case, and in it said that I want to refute the "this only impacts Salesforce owned content" statement.

0/9000

I'm not a developer and I'm looking for an easy solution to this problem:

 

We implemented an aura component just to launch a screen flow from "Global Actions." Works great, except that the window the Flow appears in once it's "Maximized" out of the corner and into the center of the screen,  is not wide enough to comfortably display the lookup values the user is supposed to select from. so I just want to widen that window.

 

Increasing the height of the Global Action doesn't help.

 

Increasing the numbers in the .svg file doesn't seem to help. (I tried increasing the 120s to 500, but didn't see a change: <svg width="120px" height="120px" viewBox="0 0 120 120"

 

I tried using some tweaked code from the article linked below, but it gives me errors and I don't know how to fix them. (Article talks about Quick Action, not Global Action)

 

Code I'm trying in the Renderer:

({

    import { LightningElement } from 'lwc';

    export default class NewFoodTripGlobalAction extends LightningElement {

         modalContainer;

         isLoaded = false;    renderedCallback() {

    if(this.isLoaded) return;

    const STYLE = document.createElement("style");

    STYLE.innerText = `.uiModal--medium .modal-container{

            width: 100% !important;

            max-width: 100%;

            min-width: 480px;

            max-height: 100%;

            min-height: 480px;

    }`;

    this.template.querySelector('lightning-card').appendChild(STYLE);

    this.isLoaded = true;

}

})

 

Error is: org.auraframework.util.json.JsonStreamReader$JsonStreamParseException: Expected ':' [2, 31]: Source

 

Note that there are 4 open curly braces and only 3 close ones - but not sure where to put another close one. I tried them in a few places, but it didn't help. I also tried adding a !important and removing it (based on someone's suggestion), but that didn't seem to change anything, either. There are no "Problems" indicated in that tab in the Dev Console.

 

Article:

https://medium.com/@gaurav.rawat194/lwc-how-to-increase-the-size-of-screen-action-modal-pop-up-in-salesforce-crm-2b6b2db34d82#id_token=eyJhbGciOiJSUzI1NiIsImtpZCI6ImUyNmQ5MTdiMWZlOGRlMTMzODJhYTdjYzlhMWQ2ZTkzMjYyZjMzZTIiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiIyMTYyOTYwMzU4MzQtazFrNnFlMDYwczJ0cDJhMmphbTRsamRjbXMwMHN0dGcuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiIyMTYyOTYwMzU4MzQtazFrNnFlMDYwczJ0cDJhMmphbTRsamRjbXMwMHN0dGcuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTM0MDQxNDQ5MjI1NDAxNDg1MjAiLCJlbWFpbCI6ImRvZGlmcmllZGVuYmVyZ0BnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwibmJmIjoxNzIyNjE1OTA3LCJuYW1lIjoiRG9kaSBGcmllZGVuYmVyZyIsInBpY3R1cmUiOiJodHRwczovL2xoMy5nb29nbGV1c2VyY29udGVudC5jb20vYS9BQ2c4b2NMSkFoeGk1LWVXUmlzRG9zWl9PbFNvVVlEOXU2Qm1nQ1BpQjV6SEtuY3dUUFNoWk8wPXM5Ni1jIiwiZ2l2ZW5fbmFtZSI6IkRvZGkiLCJmYW1pbHlfbmFtZSI6IkZyaWVkZW5iZXJnIiwiaWF0IjoxNzIyNjE2MjA3LCJleHAiOjE3MjI2MTk4MDcsImp0aSI6IjlkZmNmMGMzZjZiNzFlYjMxOGFjOWM4YWE3ZDM0ODZiMjNmZDg1NWMifQ.EM1XY06qkM8tH9pSz2-tKFtWO2G4Cz_0hzx1f8Ok2d_k8QpgT0n7dGLbQqB_nsKHkmTA6B5gv8EvKq0ebUUXoIo9LhMXoc3p6lW9spxVu8uqL4yLrB4IDczHSU2ZMa2ixA-dzQ0S-CgjW_2NUAoKK0Nur6_bqboXUrI3tpmrFOg1Jka4KbIr4dz39Znt2s1AW_PgqufjR6jFiaFb7tVEz_TFGr__AojWYXnTqOgsj7CLuvoo1c1Zp8ieZ0odP1ZjI-uh6Ny2XZeZnGKVlfXP6I-74HWn9K0b8pfVhq8fQYw7WYpVNRTez3GczIK1ipo5IR_HawiwEcqAgTCPSBpx7g)

 

Is there a different component I could use or does someone know how I can get this one to display in a wider window?

 

Thanks in advance for any suggestions.

8 answers
  1. Feb 14, 2025, 9:35 PM

    @Naseema Shaik: A developer (who shall remain nameless, unless they want to chime in here and take credit) helped me with this. The solution was not specific to the modal I wanted to widen - it widened all such modals, which was fine in our case. I can't vouch for this or help support it, but in case it helps anyone else get further along, I'll share it here: 

     

    Upload a new "Static Resource" (from a file): 

    Setup->Static Resource->New->Create "Modal_Override_90" 

     

    Upload a file containing: 

    .slds-modal__container { 

    width: 90% !important; 

    max-width: unset !important; 

     

    (I think you could try a smaller number than 90%. But I didn't have any success trying to edit it once it was uploaded.) 

     

    Aura Component (.cmp): 

    <aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:lightningQuickActionWithoutHeader" access="global"> 

    <ltng:require styles="{!$Resource.Modal_Override_90}"/> 

         

        <aura:handler name="init" value="{!this}" action="{!c.init}"/> 

        <lightning:flow aura:id="flowData"/> 

    </aura:component> 

     

    Would love to know if this helps anyone!

0/9000

Hi, 

 

I have a Digital Experience Site that my users interact with screen flows to create and update a Submissions__c record. I have an issue, on 1 of my screen flows portal users have the option to Cancel there submission, this uses an Action button Component on a Screen flow to trigger an auto launched flow that updates the record status field. My Issue is that if cancelled or no record then the other screen flow on the record page display messages about registering. This issue is that while the submission record is updates the other flows on the same screen are still cached so user can still view the information on the other screen.  

If they refresh the webpage then all other screen flow re-run with the updated decisions correctly. 

 

I am trying to create a process that once the user presses the Action Button to "Cancel" there Submission the autolaunched flow runs and then redirect the users to another page on the Digital Experience Site? 

OR 

after the Autolaunched flow is run then it forces a refresh of the webpage?     My main requriements are to clear the Cache so that it forces the other flows on the page to run again

 

Thanks 

 

@Salesforce Flow Automation@Lightning Web Components@* Salesforce Developers *@Lightning Components Development

5 answers
  1. Eric Smith (Retired) Forum Ambassador
    Jan 25, 2025, 1:47 PM

    @Callum North

     You can use this component to reactively navigate in a screen flow.  Would that help your use case? 

    https://unofficialsf.com/auto-navigate-with-screen-refresh/

0/9000

Hi, 

 

I have a LWC that gets the files from a record and displays them with a download link, I want to update this so the "Download" link is a "Download" button that does the same actions but also the abillity to run a flow when the "Download" Button is clicked too.

 

My flow has a number of input varibale to pass data in, I can get a lot of the values from the flow my LWC sits in, but not sure how I can get the FIle name/details that has been downloaded to pass through?

 

My LWC:

 

HTML:

<template>

    <lightning-card title="Documentation">

         <template for:each={filesList} for:item="file">

             <div key={file.value} class="slds-box">

                 <div class="slds-grid slds-wrap">                     

                     <div class="slds-col slds-large-size_6-of-12 slds-medium-size_4-of-12 slds-size_1-of-12">

                       <p style="font-size: large;"><strong>FileName - </strong>{file.label}</p>

                     </div>

                     <div class="slds-col slds-large-size_6-of-12 slds-medium-size_4-of-12 slds-size_1-of-12">

                       <a style="font-size: large;" href={file.url} download>Download</a>

                     </div>

                     <!--remove Preview button-->

                     <!--

                     <div class="slds-col slds-large-size_4-of-12 slds-medium-size_4-of-12 slds-size_12-of-12">

                       <lightning-button label="Preview" 

                       variant="brand"

                      data-id={file.value}

                      onclick={previewHandler}

                       ></lightning-button>

                     </div>-->

                   </div>

             </div>

         </template>

    </lightning-card> 

    

 </template>

JS:

import { LightningElement, api, wire } from 'lwc';

import getRelatedFilesByRecordId from '@salesforce/apex/filePreviewAndDownloadController.getRelatedFilesByRecordId'

import {NavigationMixin} from 'lightning/navigation'

export default class FilePreviewAndDownloads extends NavigationMixin(LightningElement) {

//pass recordId from target in meta-xml 

    @api recordId

    @api userId

    filesList =[]

    @wire(getRelatedFilesByRecordId, {recordId: '$recordId'})

    wiredResult({data, error}){ 

        if(data){ 

            console.log(data)

            this.filesList = Object.keys(data).map(item=>({"label":data[item],

             "value": item,

             //redirect to new portal site, update "procure" with new name

             "url":`/SiteName/sfsites/c/sfc/servlet.shepherd/document/download/${item}`

            }))

            console.log(this.filesList)

        }

        if(error){ 

            console.log(error)

        }

    }

    previewHandler(event){

        console.log(event.target.dataset.id)

        this[NavigationMixin.Navigate]({ 

            type:'standard__namedPage',

            attributes:{ 

                pageName:'filePreview'

            },

            state:{ 

                selectedRecordId: event.target.dataset.id

            }

        })

    }

}

meta.XML:

<?xml version="1.0" encoding="UTF-8"?>

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

    <apiVersion>62.0</apiVersion>

    <isExposed>true</isExposed>

    <targets>

        <target>lightning__RecordPage</target>

        <target>lightning__FlowScreen</target>

        <target>lightningCommunity__Page</target>

        <target>lightningCommunity__Page_Layout</target>

    </targets>

    <!--enable passing in a recordId via screen flow varriable-->

    <targetConfigs>

        <targetConfig targets="lightning__FlowScreen">

            <property name="recordId" type="String" label="Input ID" />

            <property name="userId" type="String" label="User ID" />

            </targetConfig>

    </targetConfigs>

</LightningComponentBundle>

CLS:

public with sharing class filePreviewAndDownloadController {

    @AuraEnabled(cacheable=true)

        public static Map<ID, String> getRelatedFilesByRecordId(String recordId) {

            // Get record file IDs        

            List<ContentDocumentLink> files = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId];

            List<ID> fileIDs = new List<ID>();

            for (ContentDocumentLink docLink : files) {

                fileIDs.add(docLink.ContentDocumentId);

            }

     

            List<ContentVersion> docs = [SELECT ContentDocumentId, FileExtension, Title 

                FROM ContentVersion WHERE ContentDocumentId IN : fileIDs];

            Map<ID, String> mapIdTitle = new Map<ID, String>();

            for (ContentVersion docLink : docs) {

                mapIdTitle.put(docLink.ContentDocumentId, docLink.Title);

            }

            return mapIdTitle;

        }

}

 

Thanks

 

@Lightning Web Components@Lightning Components Development

9 answers
  1. Dec 11, 2024, 1:28 PM

    Hi Callum,

     

    To get the logged in userid you can use this: 

    import Id from '@salesforce/user/Id';

    export default class MiscGetUserId extends LightningElement {

    userId = Id;

    }

    to get the file label, you'll need to use the dataset to get the data attribute:

    handledownload(event){

    this.createAuditLog(event);

    }

    createAuditLog(event){

    console.log('test123' + this.accountName + " file downloaded by "+ this.userId + this.recordId + this.item)

    const fields={};

    fields[AUDIT_TITLE.fieldApiName] = "File Downloaded";

    fields[PARENTID.fieldApiName] = this.recordId;

    fields[PARENTOBJECT.fieldApiName] = "NL_Tender_Opportunity__c";

    fields[AUDIT_DETAILS.fieldApiName] = event.target.dataset.filename +"file downloaded by "+ this.accountName;

    fields[USER_FIELD.fieldApiName] = this.userId;

    this blog explains how to pass data from a Flow to your LWC. https://salesforcediaries.com/2023/01/08/flow-to-lwc-pass-data-instantly/

     

    It looks like you have the structure for that set so perhaps there is an issue within your Flow. Anyway, you can get the recordId and AccountName from there.

0/9000

Hi,

 

I have used an LWC from https://www.salesforcetroop.com/file_preview_lwc to develop a File download LWC to get the related Files of a recordId that I pass through in a Screen flow and Dispaly the LWC in a Screen flow sitting on my Experince Site, when I test it, it works in debug/internally. I want to allow it to work on my Community portal, every one who has access is a logged into the site, but when ever I download I get a JSON file with top.location='https://domain-name.sandbox.my.site.com/ex/errorduringprocessing.jsp'

 

My portal is structured "https://domainname.sandbox.my.site.com/portalname/s/"

The URL would be on a record "https://domainname.sandbox.my.site.com/portalname/s/Objectname/recordId/toName"

 

the LWC I have used is

 

HTML:

<template>

    <lightning-card title="Documentation">

         <template for:each={filesList} for:item="file">

             <div key={file.value} class="slds-box">

                 <div class="slds-grid slds-wrap">

                     <div class="slds-col slds-large-size_4-of-12 slds-medium-size_4-of-12 slds-size_12-of-12">

                       <p><strong>FileName - </strong>{file.label}</p>

                     </div>

                     <div class="slds-col slds-large-size_4-of-12 slds-medium-size_4-of-12 slds-size_12-of-12">

                       <a href={file.url} download>Download</a>

                     </div>

                     <!--remove Preview button-->

                     <!--

                     <div class="slds-col slds-large-size_4-of-12 slds-medium-size_4-of-12 slds-size_12-of-12">

                       <lightning-button label="Preview" 

                       variant="brand"

                      data-id={file.value}

                      onclick={previewHandler}

                       ></lightning-button>

                     </div>-->

                   </div>

             </div>

         </template>

    </lightning-card> 

    

 </template>

 

Javascript:

import { LightningElement, api, wire } from 'lwc';

import getRelatedFilesByRecordId from '@salesforce/apex/filePreviewAndDownloadController.getRelatedFilesByRecordId'

import {NavigationMixin} from 'lightning/navigation'

export default class FilePreviewAndDownloads extends NavigationMixin(LightningElement) {

    @api recordId;

    filesList =[]

    @wire(getRelatedFilesByRecordId, {recordId: '$recordId'})

    wiredResult({data, error}){ 

        if(data){ 

            console.log(data)

            this.filesList = Object.keys(data).map(item=>({"label":data[item],

             "value": item,

             "url":`/sfc/servlet.shepherd/document/download/${item}`

            }))

            console.log(this.filesList)

        }

        if(error){ 

            console.log(error)

        }

    }

    previewHandler(event){

        console.log(event.target.dataset.id)

        this[NavigationMixin.Navigate]({ 

            type:'standard__namedPage',

            attributes:{ 

                pageName:'filePreview'

            },

            state:{ 

                selectedRecordId: event.target.dataset.id

            }

        })

    }

}

 

Meta-XML:

<?xml version="1.0" encoding="UTF-8"?>

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

    <apiVersion>62.0</apiVersion>

    <isExposed>true</isExposed>

    <targets>

        <target>lightning__RecordPage</target>

        <target>lightning__FlowScreen</target>

        <target>lightningCommunity__Page</target>

        <target>lightningCommunity__Page_Layout</target>

    </targets>

    <!--enable passing in a recordId via screen flow varriable-->

    <targetConfigs>

        <targetConfig targets="lightning__FlowScreen">

            <property name="recordId" type="String" label="Input ID" />

            </targetConfig>

    </targetConfigs>

</LightningComponentBundle>

 

CLS:

public with sharing class filePreviewAndDownloadController {

    @AuraEnabled(cacheable=true)

        public static Map<ID, String> getRelatedFilesByRecordId(String recordId) {

            // Get record file IDs        

            List<ContentDocumentLink> files = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId];

            List<ID> fileIDs = new List<ID>();

            for (ContentDocumentLink docLink : files) {

                fileIDs.add(docLink.ContentDocumentId);

            }

     

            List<ContentVersion> docs = [SELECT ContentDocumentId, FileExtension, Title 

                FROM ContentVersion WHERE ContentDocumentId IN : fileIDs];

            Map<ID, String> mapIdTitle = new Map<ID, String>();

            for (ContentVersion docLink : docs) {

                mapIdTitle.put(docLink.ContentDocumentId, docLink.Title);

            }

            return mapIdTitle;

        }

}

 

Thanks

 

@* Salesforce Developers *@Salesforce Flow Automation@Lightning Web Components@Lightning Components Development

1 answer
0/9000

I can't seem to figure out how to get this to work. 

 

My original intent is to input parameters into LWC component lightning input fields which values will be passed to the batch class aura-enabled method. I don't need to return anything (I simply want to execute the apex class), though I am returning a list to stick to the return data requirements (as I understand it to be a requirement).

 

The apex class works when instantiated and called in the dev console anonymous window.

Debug logs indicate that the batch class is never called from LWC.

The button is working and responding in the developer window.

Attempting to Call Batchable Apex Method

 

Debug Logs - Class Is Not Called.png

 

Widget Screenshot.png

Relevant code:

 

html

<lightning-button label="Batch Delete Records" onclick={handleClick}> </lightning-button>

<p>Returned data array: {accounts}</p>

Javascript

handleClick(event)

{

this.clickedButtonLabel = event.target.label;

console.log('clickedButtonLabel >>> '+this.clickedButtonLabel);

callMethod,{js_obj: '$html_obj', js_year: '$html_year', js_month: '$html_month', js_day: '$html_day', js_deleteAllRecords: '$value'}

.then(result => {

this.accounts = result;

this.error = undefined;

}).catch(error => {

this.error = error;

this.accounts = undefined;

})

}

Apex

@AuraEnabled

public static List<string> callMethod(String js_obj, Integer js_year, Integer js_month, Integer js_day, Boolean js_deleteAllRecords){

try {

batch_DeleteByObjCreatedDateOrAll callClass = new batch_DeleteByObjCreatedDateOrAll(js_obj, js_year, js_month, js_day, js_deleteAllRecords);

Database.executeBatch(callClass);

List<String> randomList = new List<String>();

randomList.add('first');

randomList.add('second');

randomList.add('third');

return randomList;

} catch (Exception e) {

throw new AuraHandledException(e.getMessage());

}

}

4 answers
0/9000

HI,

 

I am trying to do a LWC that countdowns until the Publication Date field, I want to update the record Status field to "Publish"when the count down end. If possible I have to also make sure that my other date field "Deadline" when current date/time is greater then this I can update the Status to "Closed".

 

My Current LWC is focused on countdown but think I need to do lots of changes to update the record, but not sure how to?

 

HTML:

<template>

    <lightning-card title="Days remaining to tender deadline:">

        <lightning-layout-item flexibility="auto" alignment-bump="right">

        <div class="slds-var-m-around_medium">

        <p>Remaining Time: {timer} </p>

        <!--<h1>Current ID: {recordId} </h1>

        <h2>Current Close Date: {deadline} </h2>-->

    </div>

</lightning-layout-item>

    </lightning-card>    

</template>

 

JS:

import { LightningElement, api, wire } from 'lwc';

import { getRecord, getFieldValue } from 'lightning/uiRecordApi';

import PUBLICATION_FIELD from '@salesforce/schema/NL_Tender_Opportunity__c.Publication_Date__c';

import STATUS_FIELD from '@salesforce/schema/NL_Tender_Opportunity__c.Status__c';

 

export default class OppCloseCountDown extends LightningElement {

    @api recordId;

    data;

    error;

    deadline;

    timer = 'Timer to start !!';

    setTimeInterval;

    @wire(getRecord, { recordId: "$recordId", fields: [PUBLICATION_FIELD], fields:[STATUS_FIELD] })

    wireMilestone({ data,error}) {

       if(data)

       {

        

      this.deadline = getFieldValue(data, PUBLICATION_FIELD);

      clearInterval(this.setTimeInterval);

      this.setTimeInterval = setInterval(() => {

        // If the count down is finished, reset to Zero

        let day = new Date(this.deadline);

        

        let ddate = day.getTime();

        //console.log(">>>ddate getTime() " + ddate); //getTime() output date in this format "1653955200000"

        let currentDateTime = new Date().getTime();

        //console.log("currentDateTime getTime " + currentDateTime);

        let timeDifference = ddate - currentDateTime;

        this.timer = 'I m timeDifference ' + timeDifference;

        //console.log("diff deadlineDate - now " + timeDifference);

        if (timeDifference < 0) {

          clearInterval(this.setTimeInterval);

          this.timer = 'Tender not Active';

        } else {

          let days = Math.floor(timeDifference / (1000 * 60 * 60 * 24));

          let hours = Math.floor(

            (timeDifference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)

          );

          let minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));

          let seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);

          this.timer =

            days + " days " + hours + " hrs " + minutes + " mins " + seconds + " secs ";

        }

      }, 1000)

       }

       else if(error)

       {

        this.error = error;

        //console.log("Error: " + JSON.stringify(error));

        this.ddate = undefined;

        //console.log('Error')

       }

    }

}

 

META.XML

<?xml version="1.0" encoding="UTF-8"?>

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

    <apiVersion>61.0</apiVersion>

    <isExposed>true</isExposed>

    <targets>

        <target>lightning__RecordPage</target>

        <target>lightning__AppPage</target>

        <target>lightning__HomePage</target>

    </targets>

    <targetConfigs>

        <targetConfig targets="lightning__RecordPage">

            <objects>

                <object>NL_Tender_Opportunity__c</object>

            </objects>

        </targetConfig>

        <targetConfig targets="lightningCommunity__Default">

            <property name="recordId" type="String" 

    label="Record ID" description="The value should be {!recordId}."/>

        </targetConfig>

        

    </targetConfigs>

</LightningComponentBundle>

 

Thanks

 

@* Salesforce Developers *@Lightning Web Components

 

 

#Salesforce Developer

3 answers
  1. Oct 25, 2024, 12:16 PM
    Does this expires within few minutes? What happens if the user is not in the LWC page when the timer expires? Why not do a flow with a schedule path?
0/9000
0/9000

Hi - I've created a LWC that works with the Outlook plug-in to find custom object records to relate an email message to. It's working fine except that the email message, once related, loses all html formatting. I'm getting the messageBody attribute from the API in the LWC and assigning it to the HtmlBody attribute of the email message in my Apex controller. Is there a different attribute I should be using? Thanks! @Lightning Web Components @* Outlook/Teams, Gmail, and Inbox *

 

#Outlook/Teams/Gmail

2 answers
  1. Oct 1, 2024, 3:34 PM

    I have encountered the same issue. There is no way to retrieve the HTML body. However, the browser console contains logs that include the htmlBody, but I'm unsure how to access it through LWC. Are there any updates on this?

0/9000