• Loreto
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi I am new at Salesforce I am working with the case object in the community. I am using a free developer Salesforce edition and I have a little problem that I have not been able to fix. I want to do some things over the FeedItem and FeedComment in the Case object so in my builder community I added the component FeedPublisher to see the 'Post' and work with it.
User-added imageThen I published my org. But after this the user can not see the Post section of the Feed Publisher and cannot comment something in the post section because it does not appear:
User-added imageThe Post should be between the section 'Conversaciones' and above the 'Sort by'.
Can anybody help me? 
Thanks
 
  • August 02, 2022
  • Like
  • 0
Hi every body I am creating a LWC that display a form with info from other object. The fields that I want to display from this objects are a Formula and a Lookup field but the Lookup field I want the text of this field not the lookup.
From the apex class y bring the data of the Id that i pass to this method and then I query with this Id and bring some text fields, formula fields and lookup fields.
But the problem is when I try to display de lookup fomula (only the Name not the posibility to modify this field) the info does not appear and the same happend to the Formula.
Can anybody help me? I cant find examples.
Hi I am creating my first LWC that displays, throw a flow wich recives the Id of the record, a form (LWC). So the flow pass the id to the lwc and this throw apex bring some fields I want to display in the form:
In .js-meta.xml I have specified the if that recives from the flow. The following code:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>54.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__HomePage</target>
<target>lightningCommunity__Page</target>
<target>lightningCommunity__Default</target>
<target>lightning__RecordPage</target>
<target>lightning__AppPage</target>
<target>lightning__FlowScreen</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__FlowScreen">
<property name="recordId" type="String" label="recordId" role='inputOnly' />
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
*******************************
the .html that display some fields from the object where I display its content (black strong):
<template>
<lightning-card title=" Mi Entregable " icon-name="standard:record">
<div class="slds-form-element__label">Entregable del curso</div><br/>
<lightning-formatted-text value={nameEntregableCurso} ></lightning-formatted-text><br/>

<div class="slds-var-m-around_medium">
<lightning-input field-name="Name"
label="Nombre de mi entregable"
class="slds-var-m-bottom_x-small"
required>
</lightning-input>
<br>
<lightning-input field-name="Student__c"
label="Nombre del estudiante"
class="slds-var-m-bottom_x-small"
required>
</lightning-input>
<br>
<lightning-radio-group name="¿En pareja?"
required
label="¿Actividad en pareja?"
options={optionsParejaButton}
value={value}
onchange={handleRadioButtonPareja}
type="radio">
</lightning-radio-group>
<br>
<template if:true={ValorSi}>
<lightning-input required field-name="NombreCompanero__c" label="Nombre del compañero">
</lightning-input>
<br>
</template>
<lightning-file-upload
label="Attach your documents"
name="fileUploader"
accept={acceptedFormats}
record-id="Id"
onuploadfinished={handleUploadFinished}
multiple>
</lightning-file-upload>
<br>
<br>
<lightning-button label="Crear entregable" variant="brand" type='submit' name='submit' onclick={createAccount}>
</lightning-button>
</div>
</lightning-card>
</template>
********************************************
the .js where I use @wire to pass the recordId from the flow to the apex function that brings me the info os that record and the fields that I specified:
//'@salesforce/schema/namespace__Custom_object__c' permite validar los campos y objetos
import { LightningElement, track, api, wire } from "lwc";
//De objeto Mi Entregable
//objeto
import OBJETO_MI_ENTREGABLE from '@salesforce/schema/Mi_entregable__c';
//Campos
import NOMBRE_MI_ENTREGABLE from '@salesforce/schema/Mi_entregable__c.Name';
import ID from '@salesforce/schema/Mi_entregable__c.Id';
import NOMBRE_COMPANERO from '@salesforce/schema/Mi_entregable__c.NombreCompanero__c';
import NOMBRE_ESTUDIANTE from '@salesforce/schema/Mi_entregable__c.Student__c';
//De objeto Entregable del curso
//Objeto
import OBJETO_ENTREGABLE_CURSO from '@salesforce/schema/Entregable_del_Curso__c'
//campos
import NAME_ENTREGABLE_CURSO from '@salesforce/schema/Entregable_del_Curso__c.Name'
import COURSE_SUBJECT from '@salesforce/schema/Entregable_del_Curso__c.Course_Subject__c';
import ENTREGABLE from '@salesforce/schema/Entregable_del_Curso__c.Entregable__c';
import TYPE from '@salesforce/schema/Entregable_del_Curso__c.Type__c';
//Metodos
import getEntregableDelCursoById from '@salesforce/apex/UAN_MiEntregable.getEntregableDelCursoById';
const FIELDS = [NAME_ENTREGABLE_CURSO,COURSE_SUBJECT,ENTREGABLE,TYPE];
export default class MiEntregable extends LightningElement {
//Variable que va a ser utilizada para guardar el Id del registro que viene del Flow
@api recordId;
@track infoEntregableCurso;
@track nameEntregableCurso;
@track courseSubject;
@track entregable;
@track type;
/**
* Wire permite llamar al metodo de la clase apex para poder pasarle parametros y recibir los resultados de este metodo en
* la variable recordEntregableCurso. Wire recibe dos parametros donde el primero de ellos es el metodo de la clase apex y el
* segundo es un objeto que guarda el Id del registro del Entregable del curso y el otro el nombre de la variable del metodo
* que recibe
*/
@wire (getEntregableDelCursoById,{recordId: '$record'})
wiredRecord({ error, data }) {
if (error) {
let message = 'Unknown error';
if (Array.isArray(error.body)) {
message = error.body.map(e => e.message).join(', ');
} else if (typeof error.body.message === 'string') {
message = error.body.message;
}
this.dispatchEvent(
new ShowToastEvent({
title: 'Error loading account',
message,
variant: 'error',
}),
);
} else if (data) {
this.infoEntregableCurso = data;
this.nameEntregableCurso = this.infoEntregableCurso.fields.NAME_ENTREGABLE_CURSO.value;
this.courseSubject = this.this.infoEntregableCurso.COURSE_SUBJECT.value ;
this.entregable = this.infoEntregableCurso.ENTREGABLE.value;
this.type = his.infoEntregableCurso.TYPE.value;
}
};
// Select option1 by default
value = '';
//Display the radio button with its values
get optionsParejaButton() {
return [
{ label: 'Si', value: 'option1' },
{ label: 'No', value: 'option2' },
];
}
value = 'option2';
//handle event when option1 is selected displays the field Nombre del compañero
@track ValorSi = false;
handleRadioButtonPareja(event){
const selectedOption = event.detail.value;
if(selectedOption == 'option1'){
this.ValorSi = true;
}else{
this.ValorSi = false;
}
}
get acceptedFormats() {
return ['.pdf', '.png','.jpg','.mp3','.zip','.z','.rar','.csv','.sql','.xml','.jpeg','.xls','.xlsx','.mp4','.doc','.docx','.txt'];
}
handleUploadFinished(event) {
// Get the list of uploaded files
const uploadedFiles = event.detail.files;
alert('No. of files uploaded : ' + uploadedFiles.length);
}
}
*******************************
and then the apex method:
@AuraEnabled(cacheable=true)
public static Entregable_del_Curso__c getEntregableDelCursoById(Id recordId){
Entregable_del_Curso__c recordEntregableCurso = [SELECT Id, Name, Course_Subject__c, Entregable__c, Type__c
FROM Entregable_del_Curso__c
WHERE Id =: recordId];
return recordEntregableCurso;
}

but when I try to push my js this sais that in my .htmlhas the next errors (pic): duplicate value found: <unknown> duplicates value on record with id: <unknown>
Cannot find Lightning Component Bundle MiEntregable.
Cannot find Lightning Component Bundle MiEntregable.

User-added imagecould anybody help me to fix this? I have read a post with the same title as mine but could not find the answer.
Thanks
Hi I am new at Salesforce I am working with the case object in the community. I am using a free developer Salesforce edition and I have a little problem that I have not been able to fix. I want to do some things over the FeedItem and FeedComment in the Case object so in my builder community I added the component FeedPublisher to see the 'Post' and work with it.
User-added imageThen I published my org. But after this the user can not see the Post section of the Feed Publisher and cannot comment something in the post section because it does not appear:
User-added imageThe Post should be between the section 'Conversaciones' and above the 'Sort by'.
Can anybody help me? 
Thanks
 
  • August 02, 2022
  • Like
  • 0