• Svanekey
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies

Hello Folks, 

Is there any chance to run RefreshApex after DML insert is committed sucessfully? 

Scenario Is: 

Into LWC, we run GET API and receive the response. From response data, we are creating custom objects into Salesforce. Once they are created, we are redirected to object List View page, but we still see empty page as it needs to be refreshed to see the newest set of data.

Now I am using  "window.location.reload(1)" after we are landed to object List view Page,  but hard refresh is not the best solution here. My goal is to refresh the LWC datatable after insert DML operation is sucessfull without hard refreshing the page. Please advice? Here is my Wire method below. 

//Fetching Objects
    @wire(FetchObjects)
    wiredRecords(result) {
        this.objectList = result;
        if (result.data) {
            this.record = result.data;
            this.error = undefined;

//Somewhere here I need the RefreshApex, or Alternative to rerender LWC datatable withot hard refreshing the page. 

        } else if (result.error) {
            this.error = result.error;
            this.record = [];
        }
           
    }

Thanks a lot. 

 

 

Hi Folks, 

I am trying to assign Custom Labels as a Radio Group values into LWC but with no success. Please share your thoughs how do I do that Properly?  

- So I imported Custom labels into JS file. 
- Stored them into label object
- How do assign it to "Options" that Radio group could use it? 

Please see code below and screen shoot, how it should look like at the end. So in place of the current Radio Options, there should be custom labels displayed.

HTML **************************************************************

            <lightning-radio-group name="Random Radio"
                        label="Radio"
                        options={options}
                        value={value}
                        required
                        type="radio"
                        onchange= {handleChange}>
            </lightning-radio-group>    

JS ******************************************************************

import { LightningElement, wire, track, api } from 'lwc';
import customLabel1 from '@salesforce/label/c.label1';
import customLabel2 from '@salesforce/label/c.label2';
import customLabel3 from '@salesforce/label/c.label3';

export default class RandomClass extends LightningElement {

label {
    label1,
    label2,
    label3
}

get options() {
        return [
            { //Custom Label 1 Here },
            { //Custom Label 2 Here },
            { //Custom Label 3 Here },

        ];  
    }
}

Dear Trailblazers, 

I am having a screen flow where I use LWC component. In the screen flow I have a variable named "RecDescription". I use this variable as a input parameter for LWC component. (Screen shoot below)User-added image

In my LWC JS file, I defne it as  @api RecDescription. 

My question is: How to use the value from RecDescription to LWC input field? 

I have a input field "Comments" when user opens the LWC screen, the value from @api RecDescription should be automaticaly visible into "Comments" field. (Please see screen shoot below)

<lightning-textarea name="Comments" label="Comments" value={commentsValue} onchange={handleChangeComments}></lightning-textarea>

User-added image

I need JS method to get value from @api RecDescription and set to be visible into "Comments" input field. 

 

Please share your thoughts. Thanks a lot.