• CARLOS RODRIGO DEL TORO ORTIZ
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I'm trying to pass a list of assets to the lwc from the controller but when reviewing the data, only the values of the standard fields are arriving, the custom fields do not appear

This is my controller
 
public with sharing class CarouselBannerController {
    @AuraEnabled(cacheable=true)
    public static List<Asset> getBanners() {
        List<Asset> ls = [
                            SELECT ID,Name,Activo__c,Audiciencias__c,url__c
                            FROM Asset
                            ORDER BY Name
                        ];
        Map<Id, Asset> m = new Map<Id, Asset>(ls);
        return ls;
        
    }
}



This is my carouselBanner.js
import { LightningElement,track,wire } from 'lwc';
import getBanners from '@salesforce/apex/CarouselBannerController.getBanners';


export default class CarouselBanner extends LightningElement {
    bannerResult;
    error;

    @wire(getBanners)
    wireBanners({error,data}){
        if(data){
            this.bannerResult = data;
            detail : this.bannerResult;
            console.log("resultado" + JSON.stringify(this.bannerResult))
        }else if (error){
            this.error = error;
            this.bannerResult = undefined;
        }
    }
}


the query has this data
 
| ID                  | NAME      | ACTIVO__C  | AUDICIENCIAS__C        | URL__C
|:------------------  | :-------- |:---------  |:---------------------  | ----------
| 02i19000003f5H0AAI  | Banner1   | false      | Brasil;Chile;Colombia  |www.google.com
| 02i19000003f46yAAA  | Banner2   | true       | Argentina              |https://player.vimeo.com/video/241135386
| 02i19000003f56wAAA  | Banner3   | true       | Colombia;Ecuador       |www.google.com


In the console.log only show me the error 

Error: [LWC error]: Invalid template iteration for value "undefined" in [object:vm undefined (12)]. It must be an Array or an iterable Object

and it only shows the values of the fields ID and NAME which are standard fields of the object
 
resultado[
{"Name":"Banner1","Id":"02i19000003f5H0AAI"},
{"Name":"Banner2","Id":"02i19000003f46yAAA"},
{"Name":"Banner3","Id":"02i19000003f56wAAA"}
]


but custom fields Activo__c,Audiciencias__c,url__c not appear , and i do not why

 
I'm trying to add the Feed Post & comments component to my page but doing so shows me the message This component has no data - We can't load the Feed Posts & comments component because it's not supported by any data, once you add data, reload Experience Builder to see your component
User-added image

but the component is chatter, it is assumed that it will not have data until the comments are made.

There is not much information in the forum on how to solve this problem.

I appreciate any help

Pd: I already checked in the forum and I only found this post (https://developer.salesforce.com/forums/?id=9060G0000005ZGtQAM) and it works with aura components and following that solution, as happened to the person who asked, I could not solve it either
I'm trying to add the Feed Post & comments component to my page but doing so shows me the message This component has no data - We can't load the Feed Posts & comments component because it's not supported by any data, once you add data, reload Experience Builder to see your component
User-added image

but the component is chatter, it is assumed that it will not have data until the comments are made.

There is not much information in the forum on how to solve this problem.

I appreciate any help

Pd: I already checked in the forum and I only found this post (https://developer.salesforce.com/forums/?id=9060G0000005ZGtQAM) and it works with aura components and following that solution, as happened to the person who asked, I could not solve it either
I've set-up a basic community and got it running.  But when I drag components onto the Home Page I get a message such as this: 

Community Home Page

What I'd like to do is put the user details on the home page for editing.  Can this be done?