• Terry Ulanch
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
I have issue, unable to install data.com  insuffient rights

using the trailhead env for the challenge in the

Learn CRM Essentials  Data Quality
Assessing the Quality of Data  

 
I have issue, unable to install data.com  insuffient rights

using the trailhead env for the challenge in the

Learn CRM Essentials  Data Quality
Assessing the Quality of Data  

 
Hi all, I am working on the Handle Server Error part in Trailhead as part of the Lightning Web Components and Salesforce Data Module

https://trailhead.salesforce.com/en/content/learn/modules/lightning-web-components-and-salesforce-data/handle-server-errors?trail_id=build-lightning-web-components

I am attempting to allow for error handling and write my code as follows

ContactList.js
import { LightningElement, wire } from 'lwc';
import {
    reduceErrors
} from 'c/ldsUtils';
import getContactList from '@salesforce/apex/ContactController.getContactList';

export default class ContactList extends LightningElement {
    @wire(getContactList) contacts;

    handleSelect(event) {
        // 1. Prevent default behavior of anchor tag click which is to navigate to the href url
        event.preventDefault();
        // 2. Create a custom event that bubbles. Read about event best practices at http://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.events_best_practices
        const selectEvent = new CustomEvent('contactselect', {
            detail: { contactId: event.currentTarget.dataset.contactId }
        });
        // 3. Fire the custom event
        this.dispatchEvent(selectEvent);
    }
    get errors() {
        return (this.accounts.error) ?
            reduceErrors(this.accounts.error) : [];
    }
}



contactList.html
<template>
    <template if:true={contacts.data}>
        <template if:true={errors}>
            <p>{errors}</p>
        </template>
        <template for:each={contacts.data} for:item="contact">
            <a
                href="#"
                key={contact.Id}
                data-contact-id={contact.Id}
                onclick={handleSelect}
            >
                <lightning-layout>
                    <lightning-layout-item>
                        <img src={contact.Picture__c} alt="Profile photo" />
                    </lightning-layout-item>
                    <lightning-layout-item padding="horizontal-small">
                        <p>{contact.Name}</p>
                    </lightning-layout-item>
                </lightning-layout>
            </a>
        </template>
    </template>
</template>

ContactController.cls
public with sharing class ContactController {
    @AuraEnabled(cacheable=true)
    public static List<Contact> getContactList() {
        throw new AuraHandledException('Forced error');
        /*return [
            SELECT Id, Name, Title, Phone, Email, Picture__c
            FROM Contact
            WHERE Picture__c != null
            WITH SECURITY_ENFORCED
            LIMIT 10
        ];*/
    }

    @AuraEnabled(cacheable=true)
    public static List<Contact> findContacts(String searchKey) {
        String key = '%' + searchKey + '%';
        return [
            SELECT Id, Name, Title, Phone, Email, Picture__c
            FROM Contact
            WHERE Name LIKE :key AND Picture__c != null
            WITH SECURITY_ENFORCED
            LIMIT 10
        ];
    }

    @AuraEnabled(cacheable=true)
    public static Contact getSingleContact() {
        return [
            SELECT Id, Name, Title, Phone, Email, Picture__c
            FROM Contact
            WITH SECURITY_ENFORCED
            LIMIT 1
        ];
    }
}




But I get this error We can’t find 'reduceErrors' imported into contactList.js. Any steps I need to take here.

 
Where do I find custom object 'Case Study'? Is it in the Trailhead playground or Developer edition org?
In the trailhead "Creating Object-Specific Quick Actions" section, "Add an Action to an Object’s Page Layout" paragraph, I creat a Quick Action to creat a Contact from the Account Object.  However, when I edit the object and try to move it to the Account layout from the Salesforce1 Actions Palette to either of the "Quick Actions in the Salesforce Classic Publisher" or the "Salesforce1 and Lightning Experience Actions" it will not move. 

I can move it from the Quick Actions palette to the "Quick Actions in the Salesforce Classic Publisher". 

These are the instructions I'm following:

4. Click the Salesforce1 Actions category in the palette.
On object page layouts, the Salesforce1 Actions category contains all available types of actions for the object, including quick actions, productivity actions, and standard and custom buttons.


5. Drag some actions from the palette into the Salesforce1 and Lightning Experience Actions section.

They just don't work.  :-(

Mike
 
I cannot for the life of me, figure out what could be wrong with my campingList component markup for the "Create a Simple Camping List Lightning Component" challenge.  This is the markup for campingList.cmp:

<aura:component>
     <ul>
        <li>Bug Spray</li>
        <li>Bear Repellant</li>
        <li>Goat Food</li>
    </ul>
 </aura:component>

Please help me figure out why I am getting the error.  Thank you, Susan