How pass record id from quick action to lwc

Do you need to create a quick action that passes the record id to a Lightning Web Component? This note might be useful to you.
Here you find the example of the LWC template and its controller

				
					<template>
    <template if:true={recordId}>
        test
    </template>
</template>				
				
					import { LightningElement, api } from 'lwc';
export default class Testing extends LightningElement {
    @api recordId;
    connectedCallback() {
        console.log('connected===============');
        console.log(this.recordId);
    }
    renderedCallback() {
        console.log('rendered------------');
        console.log(this.recordId);
    }
}				

Leave a Reply

en English
en Englishfr Frenchde Germanit Italian