• Mạnh Nguyễn
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
 Experience Builder
User-added imageMy Code
<aura:component implements = "forceCommunity:themeLayout" extends="forceCommunity:navigationMenuBase" access = "global" description = "Login Theme">
    <ltng:require styles = "{!$Resource.Design + '/css/comm.css'}"/>
    
    <aura:attribute name = "search" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "profileMenu" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "language" type = "Aura.Component[]" required = "true"/>
    <aura:attribute name = "newHeader" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "showSearch" type="Boolean" default="true" />


    <div class="landing-theme">        
        <div class="landing-header">
            
            <div class="header-logo">                
                <a href="javascript:void(0);" class="desktop-version">
                    <img src="{!$Resource.CommunityIcon + '/CommunityIcon/logo.png'}" onclick="{!c.goLoginMainPage}"/>                                        
                </a>
                
                <a href="javascript:void(0);" class="mobile-version">
                    <img src="{!$Resource.CommunityIcon + '/CommunityIcon/Logo-mobile.png'}" onclick="{!c.goLoginMainPage}"/>                                        
                </a>
            </div>

            <div class="header-contactus">                
                <a href="javascript:void(0);" class="text_h5 h5--OpenSans-Bold" onclick="{!c.goContactUsPage}">{!$Label.c.B2B_PublicContactUs}</a>                
            </div>

            <div class="header-language">
                <div class="header-language_icon">
                    <span class="slds-button slds-button_icon" tabindex="0" title="Language">
                        <lightning:icon class="left-world" iconName="utility:world" size="small" alternativeText="Language"/>
                    </span>
                </div>

                <div class="header-language_selection">
                    {!v.language}  
                </div>
            </div>

            <div class="header-search">
                <img src="{!$Resource.CommunityIcon + '/CommunityIcon/icon_global_search.png'}" alternativeText="search"/>
            </div>
        </div>
        <div class="landing-content">
            <div class="landing-body">
                {!v.body}
            </div>
    
            <div class="landing-footer">
                <c:B2B_Footer/>
            </div>
        </div>        
    </div>
</aura:component>


I can't add "language selection"  to language component (1) though before that i could ( For some reason I had to delete it ).

What do I need to do to use it ?

i have a quest : 
- create a list view contact
- list have edit + view button

this is my code : 

listview.cmp
<aura:component controller="ContactController" implements="force:appHostable,
                                                           flexipage:availableForAllPageTypes,
                                                           force:hasRecordId">
    
    <aura:attribute type="Contact[]" name="contList"/>
    <aura:attribute name="mycolumns" type="List"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.fetchCt}"/>
    
    <lightning:datatable data="{! v.contList }"
                         columns="{! v.mycolumns }"
                         keyField="id"
                         hideCheckboxColumn="true"
                         onrowaction="{!c.handleRowAction}" />"
</aura:component>

listviewController.js
({
    fetchCt : function(component, event, helper) {
        var actions = [
            {label:'Edit',name:'edit'},
            {label:'View',name:'view'}
        ];
        component.set('v.mycolumns', [
            {label: 'ContactName', fieldName: 'Name', type: 'text'},
            {label: 'Email', fieldName: 'Email', type: 'text'},
            {label: 'Phone', fieldName: 'Phone', type: 'Phone'},
            {label: 'Title', fieldName: 'Title', type: 'Text'},
            {label:'Status',fieldName:'Status',type:'picklist'},
            {type:'action',typeAttributes:{rowActions:actions}}
        ]);
        var action = component.get("c.fetchContacts");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.contList", response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
    },
    handleRowAction: function ( cmp, event, helper ) {
        
        var action = event.getParam( 'action' );
        var row = event.getParam( 'row' );
        var recId = row.Id;
        console.log('RecordId',recId);
        switch ( action.name ) {
            case 'edit':
                var editRecordEvent = $A.get("e.force:editRecord");
                editRecordEvent.setParams({
                    "recordId": recId
                });
                editRecordEvent.fire();
                break;
            case 'view':
                var viewRecordEvent = $A.get("e.force:navigateToURL");
                viewRecordEvent.setParams({
                    "url": "/" + recId
                });
                viewRecordEvent.fire();
                break;
        }
    }
})

contactController.apxc
public class ContactController {
    @AuraEnabled
    public static List <Contact> fetchContacts() {
        //Qyery 10 accounts
        List<Contact> contList = [Select Id, Name, Email, Title, Phone From Contact];
        //return list of accounts
        return contList;
    }
}


i used this doc : 
https://developer.salesforce.com/docs/component-library/bundle/force:editRecord/documentation

Error : 
This page has an error. You might just need to refresh it. Action failed: c:listView$controller$handleRowAction [Cannot read property 'setParams' of undefined] Failing descriptor: {c:listView$controller$handleRowAction}
User-added image

please someone have me, thanks.
 Experience Builder
User-added imageMy Code
<aura:component implements = "forceCommunity:themeLayout" extends="forceCommunity:navigationMenuBase" access = "global" description = "Login Theme">
    <ltng:require styles = "{!$Resource.Design + '/css/comm.css'}"/>
    
    <aura:attribute name = "search" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "profileMenu" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "language" type = "Aura.Component[]" required = "true"/>
    <aura:attribute name = "newHeader" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "showSearch" type="Boolean" default="true" />


    <div class="landing-theme">        
        <div class="landing-header">
            
            <div class="header-logo">                
                <a href="javascript:void(0);" class="desktop-version">
                    <img src="{!$Resource.CommunityIcon + '/CommunityIcon/logo.png'}" onclick="{!c.goLoginMainPage}"/>                                        
                </a>
                
                <a href="javascript:void(0);" class="mobile-version">
                    <img src="{!$Resource.CommunityIcon + '/CommunityIcon/Logo-mobile.png'}" onclick="{!c.goLoginMainPage}"/>                                        
                </a>
            </div>

            <div class="header-contactus">                
                <a href="javascript:void(0);" class="text_h5 h5--OpenSans-Bold" onclick="{!c.goContactUsPage}">{!$Label.c.B2B_PublicContactUs}</a>                
            </div>

            <div class="header-language">
                <div class="header-language_icon">
                    <span class="slds-button slds-button_icon" tabindex="0" title="Language">
                        <lightning:icon class="left-world" iconName="utility:world" size="small" alternativeText="Language"/>
                    </span>
                </div>

                <div class="header-language_selection">
                    {!v.language}  
                </div>
            </div>

            <div class="header-search">
                <img src="{!$Resource.CommunityIcon + '/CommunityIcon/icon_global_search.png'}" alternativeText="search"/>
            </div>
        </div>
        <div class="landing-content">
            <div class="landing-body">
                {!v.body}
            </div>
    
            <div class="landing-footer">
                <c:B2B_Footer/>
            </div>
        </div>        
    </div>
</aura:component>


I can't add "language selection"  to language component (1) though before that i could ( For some reason I had to delete it ).

What do I need to do to use it ?

i have a quest : 
- create a list view contact
- list have edit + view button

this is my code : 

listview.cmp
<aura:component controller="ContactController" implements="force:appHostable,
                                                           flexipage:availableForAllPageTypes,
                                                           force:hasRecordId">
    
    <aura:attribute type="Contact[]" name="contList"/>
    <aura:attribute name="mycolumns" type="List"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.fetchCt}"/>
    
    <lightning:datatable data="{! v.contList }"
                         columns="{! v.mycolumns }"
                         keyField="id"
                         hideCheckboxColumn="true"
                         onrowaction="{!c.handleRowAction}" />"
</aura:component>

listviewController.js
({
    fetchCt : function(component, event, helper) {
        var actions = [
            {label:'Edit',name:'edit'},
            {label:'View',name:'view'}
        ];
        component.set('v.mycolumns', [
            {label: 'ContactName', fieldName: 'Name', type: 'text'},
            {label: 'Email', fieldName: 'Email', type: 'text'},
            {label: 'Phone', fieldName: 'Phone', type: 'Phone'},
            {label: 'Title', fieldName: 'Title', type: 'Text'},
            {label:'Status',fieldName:'Status',type:'picklist'},
            {type:'action',typeAttributes:{rowActions:actions}}
        ]);
        var action = component.get("c.fetchContacts");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.contList", response.getReturnValue());
            }
        });
        $A.enqueueAction(action);
    },
    handleRowAction: function ( cmp, event, helper ) {
        
        var action = event.getParam( 'action' );
        var row = event.getParam( 'row' );
        var recId = row.Id;
        console.log('RecordId',recId);
        switch ( action.name ) {
            case 'edit':
                var editRecordEvent = $A.get("e.force:editRecord");
                editRecordEvent.setParams({
                    "recordId": recId
                });
                editRecordEvent.fire();
                break;
            case 'view':
                var viewRecordEvent = $A.get("e.force:navigateToURL");
                viewRecordEvent.setParams({
                    "url": "/" + recId
                });
                viewRecordEvent.fire();
                break;
        }
    }
})

contactController.apxc
public class ContactController {
    @AuraEnabled
    public static List <Contact> fetchContacts() {
        //Qyery 10 accounts
        List<Contact> contList = [Select Id, Name, Email, Title, Phone From Contact];
        //return list of accounts
        return contList;
    }
}


i used this doc : 
https://developer.salesforce.com/docs/component-library/bundle/force:editRecord/documentation

Error : 
This page has an error. You might just need to refresh it. Action failed: c:listView$controller$handleRowAction [Cannot read property 'setParams' of undefined] Failing descriptor: {c:listView$controller$handleRowAction}
User-added image

please someone have me, thanks.
I'm having trouble validating challenge 2, with regard to Shinje Tashi's user settings.
ERROR: 
Challenge Not yet complete... here's what's wrong: 
Shinje Tashi does not have the user settings he needs.

The instructions say: "This sales data quality specialist supports the entire company and needs to be assigned a role that can see and access all account, contact, and opportunity records for the entire company. Use the Standard User profile."

First off, it seems odd not to handle this through a separate profile, but I'm trying to follow the directions. So...

I created Shinje as an active user, User License: Salesforce, Profile: Standard User. There isn't a role specified for him, and the instructions suggest providing access to all acct, contact and oppty records through a role assignment, so I created a Sales Data Admin role, reporting to the CEO. That role should provide RECORD access. Additionally, for OBJECT access, I created a permission set granting full access (CRED, View All, Modify All) to Acct, Contact, and Oppty objects and assigned it to Shinje. I created a separate permission set granting access to the Language preference field on Acct, named that permission set "Bilingual Pilot" as instructed, and assigned it to Shinje.

I'm not sure what I'm missing...