• Michael Muchow
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi guys,
I'm trying to wire a function as described here (https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.data_wire_service_about).

This is my code:
 
@wire(getRecord, { recordId: '$recordId', fields: ['Lead.Name'] })
    wiredRecord({ error, data}){
        if (data) {
            this.record = data;
            this.error = undefined;
        } else if (error) {
            this.error = error;
            this.data = undefined;
        }
        console.log('test '+JSON.stringify(this.record));
    };

get test() { 
    return this.record.fields.Name.value; 
}
Everything works fine and I got the following log of the data:
{"apiName":"Lead","childRelationships":{},"fields":{"Name":{"displayValue":null,"value":"Test Name"}},"id":"00Q0D000001njilUAA","lastModifiedById":"005240000052XZeAAM","lastModifiedDate":"2019-03-21T13:41:40.000Z","recordTypeInfo":{"available":true,"defaultRecordTypeMapping":true,"master":false,"name":"Customer","recordTypeId":"01224000000SVMWAA4"},"systemModstamp":"2019-03-21T13:41:40.000Z"}
If I want to access the value like it described in the link (e.g. this.record.fields.Name.value;) with this.record.fields.Name.value; I get the error:

Cannot read property 'fields' of undefined

What is wrong and why can't I access the fields/value?

 

Hi guys,
I have a Lightning Web Component, this component sits on the Record Page and gets the record id by import { getRecord } from 'lightning/uiRecord';

With this id and some Custom Metadata I query some data of this record by an apex class and give it back to the template to show it.

Now I want to refresh/call the apex class again to get the updated data if the record was updated.

How can I do this?

Hi guys,
I'm trying to build a component with the new Map component.
It works most of the time fine but I have some troubles on records without a latitude / longitude like person accounts or contacts.

For most of the addresses it works fine but for other I get the wrong map position.

Like 

Zossener Straße 56
15838 Am Mellensee
Germany

My map component on a person account record shows me the Salesforce Tower but the already integrated map below the address compound field shows me the correct position.

Is there any other possible solution than update the latitude and longitude per trigger?

Another question is, if someone updates the address the map component will not refresh but the location variable has the new values, but the map stays the same.
Hi guys,
I'm trying to wire a function as described here (https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.data_wire_service_about).

This is my code:
 
@wire(getRecord, { recordId: '$recordId', fields: ['Lead.Name'] })
    wiredRecord({ error, data}){
        if (data) {
            this.record = data;
            this.error = undefined;
        } else if (error) {
            this.error = error;
            this.data = undefined;
        }
        console.log('test '+JSON.stringify(this.record));
    };

get test() { 
    return this.record.fields.Name.value; 
}
Everything works fine and I got the following log of the data:
{"apiName":"Lead","childRelationships":{},"fields":{"Name":{"displayValue":null,"value":"Test Name"}},"id":"00Q0D000001njilUAA","lastModifiedById":"005240000052XZeAAM","lastModifiedDate":"2019-03-21T13:41:40.000Z","recordTypeInfo":{"available":true,"defaultRecordTypeMapping":true,"master":false,"name":"Customer","recordTypeId":"01224000000SVMWAA4"},"systemModstamp":"2019-03-21T13:41:40.000Z"}
If I want to access the value like it described in the link (e.g. this.record.fields.Name.value;) with this.record.fields.Name.value; I get the error:

Cannot read property 'fields' of undefined

What is wrong and why can't I access the fields/value?

 

Hi guys,
I have a Lightning Web Component, this component sits on the Record Page and gets the record id by import { getRecord } from 'lightning/uiRecord';

With this id and some Custom Metadata I query some data of this record by an apex class and give it back to the template to show it.

Now I want to refresh/call the apex class again to get the updated data if the record was updated.

How can I do this?