export default class ShowToast extends LightningElement {
@api recordId;
account;
lastModifiedDate;
createddate;
check=true;
@wire(getRecord, { recordId: '$recordId', fields: FIELDS })
wiredRecord({ error, data }) {
if (error) {
console.log('error occured');
} else if (data) {
this.account = data;
console.log('Log after isloading account>>>>>>', this.account);
let modifiedDate=this.account.lastModifiedDate;
//let createdate=this.account.createddate
if(!this.lastModifiedDate) {
this.lastModifiedDate = this.account.lastModifiedDate;
console.log('Console lastmodified date---->',this.lastModifiedDate);
}
if (modifiedDate != this.lastModifiedDate || modifiedDate == this.lastModifiedDate ) {
console.log('Console modified date---->',this.lastModifiedDate,modifiedDate);
let rate = getFieldValue(this.account, RATING_FIELD) ?getFieldValue(this.account, RATING_FIELD) : ''
let usrfield = getFieldValue(this.account, USER_FIELD) ?getFieldValue(this.account, USER_FIELD) : ''
console.log('Need user available field from user here>>'+ usrfield);
if(rate =='Hot')
{
console.log('rate debug---->',rate);
alert('YOU HAVE SELECTED ACCOUNT RATING AS HOT');
}
if(usrfield) //.User_Available__c =='True'
{
console.log('Console user usrfield123>>>',usrfield);
alert(' User is Not Selected ');
}
this.showNotification();
}
Every thing is working good I just dont want to show alert message when i refresh the account record detail page