2

I have lwc component built few months ago place on record pages, was working perfectly fine (and still works with winter'20 orgs). But started breaking on spring'20 sandbox and spring'20 scratch-orgs.

My observation 1. On-load of the record page returns 'undefined' value for 'recordId' and 'filtervalue' (this mandatory config value).

Sample js code

import { LightningElement, wire, track, api } from "lwc";
import { refreshApex } from "@salesforce/apex";
import getObjectMapping from "@salesforce/apex/SearchUtilityHelper.getobjectMappings";


/* eslint-disable no-console */
export default class AddressSearchUtility extends LightningElement {

  @api recordId;
  @track SearchObjectMappingdata = [];
  @track SearchObjectMappingerror;

  @wire(getObjectMapping, {
    filtervalue: "$filtervalue"
  })
  objetMappinginfo({ error, data }) {
      console.log("Record ID: "+ this.recordId); // onload returns undefined
      console.log("filtervalue "+ this.filtervalue); // onload returns undefined
    if (data) {
      this.SearchObjectMappingdata = data;
      this.SearchObjectMappingerror = undefined;
    } else if (error) {
      this.SearchObjectMappingerror = error;
      this.SearchObjectMappingdata = undefined;
    }
  }
}

.js-meta.xml below

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="addressSearchUtility">
<apiVersion>47.0</apiVersion>
<isExposed>true</isExposed>
<masterLabel>Search</masterLabel>
<description>Generic components for search</description>
<targets>
    <target>lightning__RecordPage</target>
    <target>lightning__AppPage</target>
    <target>lightning__HomePage</target>
</targets>
<targetConfigs>
    <targetConfig targets="lightning__RecordPage">
        <property name="filtervalue" required="true" type="String" description="filtervalue" />
    </targetConfig>
</targetConfigs>

0

You must log in to answer this question.

Browse other questions tagged .