• Srikanth Dasari
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi, 
when button is clicked, the date field should populate as today's date. i am trying in LWC and its doesnt work. please see below code.

HTML:
<template>
   
    <lightning-button
                     class="slds-button slds-button_brand"
                      label="Resignation"
                      variant="brand"
                      onclick={updateDate}>
    </lightning-button>
</template>

JS:

import { LightningElement, api, wire} from 'lwc';
import {getRecord} from 'lightning/uiRecordApi';
import RESIGN_FIELD from '@salesforce/schema/Employee_Information__c.DN_Resignation_Date__c';
const fields = [RESIGN_FIELD];
export default class ResignButton extends LightningElement {
    @api recordId;
    @wire(getRecord, { recordId: '$recordId', fields })
    employee_Information__c;
updateDate(){
    let fields = new Date().toISOString();
}
}