• Paritosh Bhatia
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
Getting this error while running apex test classes after the Winter 2021 release on our sandbox. The apex test in question does not use any einstein functionalities.
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?

 
Dear all,

I'm struggling with getting checkpoints to do anything for me in the Developer Console:
  1. I set the checkpoint in my test class
  2. I set the debugging logs to "finer" or "finset" on the apex code.
  3. I run the test class
  4. Nothing seems to appear in my checkpoints history.
User-added image

I've read these 2 pages in the help, but I don't know what I'm missing:
https://help.salesforce.com/apex/HTViewHelpDoc?id=code_dev_console_checkpoints_setting.htm&language=en_US (https://help.salesforce.com/apex/HTViewHelpDoc?id=code_dev_console_checkpoints_setting.htm&language=en_US)
https://help.salesforce.com/apex/HTViewHelpDoc?id=code_dev_console_tab_browser_logs.htm&language=en_US#set_log_levels (https://help.salesforce.com/apex/HTViewHelpDoc?id=code_dev_console_tab_browser_logs.htm&language=en_US#set_log_levels)

Every so often, I attempt to use the Developer Console, but I'm always immediately blocked by a lack of clarity in the functionality and documentation. I've sat through the webinars on the developer console, but can never replicate the behaviours that I see in their examples.
  • I can never find a useful stack trace (to see where methods have been called from) - Even if I open the "stack trace" view/window
  • I can never get checkpoints to work
  • The console slows down and becomes unusable very quickly
I'm not trying to post a grumpy post of all my grievances, but it would be good to get clarity if the issue is with me/my set-up or the console itself (or a mixture of the two).

I noticed that outputFields now have a label attribute (as of 23.0). I had a little go at using it and found no results.

 

I presume that the result should be that I wouldn't have to use outputLabel anymore. Is this feature not working or am I thinking incorrectly?

 

<apex:outputField value="{!var}" label="My Variable" />