Skip to main content
2 of 2
added 425 characters in body
salesforce-sas
  • 24.5k
  • 5
  • 44
  • 79
handleOnLoad() {
    let name = this.template.querySelector('.name').value;
    alert(name);
}

This will work.

BUT above approach is not good. You can get all the values based on recordId as below

handleOnLoad(event) {
    var record = event.detail.records;
    var fields = record[this.recordId].fields; // record['0010K000026Y******'].fields;
    const accName = fields.Name.value;      
    alert(accName);
    //const myfieldVal = fields.myfield__c.value;
    //alert(myfieldVal);
}
salesforce-sas
  • 24.5k
  • 5
  • 44
  • 79