• Arrielle Kooiman
  • NEWBIE
  • 15 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 10
    Replies
I've been stuck on this for so long and can't figure out why it's not working. I'm simply trying to pull in the value of a field from a record. The lightning component is on a community case record page. 

Here is my meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>47.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
      <target>lightning__RecordPage</target>
      <target>lightningCommunity__Page</target>
      <target>lightningCommunity__Default</target>
  </targets>
  <targetConfigs>
      <targetConfig targets="lightning__RecordPage">
          <objects>
              <object>Case</object>
          </objects>
      </targetConfig>
      <targetConfig targets="lightningCommunity__Default">
          <property name="recordId" type="String" label="Record ID" description="Should be set to {!recordId}"/>
      </targetConfig>
  </targetConfigs>
</LightningComponentBundle>
I think this is correct as it can be placed on my community page and has the property 'Record Id'. I've filled that property with {!recordId}.


Here is my .js
import { LightningElement, api, wire,track } from 'lwc';
import { getRecord, getFieldValue } from 'lightning/uiRecordApi';

import CUSTOM_FIELD from '@salesforce/schema/Case.My_Custom_Field__c';
const fields = [CUSTOM_FIELD];

export default class WatchListAlert extends LightningElement {
    @api recordId; 
    @track selectedOption; 

    @wire(getRecord, { recordId: '5003I000001JZ2gQAG', fields })
    case;

    @wire(getRecord, { recordId: '$recordId', fields })
    case2;

    connectedCallback() {     
            console.log('this.recordId: ', this.recordId); //<--- Shows correct record Id

            this.selectedOption = getFieldValue(this.case.data, RESULTS_FIELD);
            this.selectedOption2 = getFieldValue(this.case2.data, RESULTS_FIELD); //Data is undefined... can't read property 'data' of undefined.

            console.log('this.selectedOption: ', this.selectedOption); //<---- OK
            console.log('this.selectedOption2: ', this.selectedOption2); //---- NOT OK
    }


}

When I attempt to get the case record and the related field with a hard coded record id, the value shows up. But when I use $recordId the case.data is coming back as undefined. 

When I console log the recordId it's showing the correct recordId so I really have no idea what's wrong with my code.

Any help is much apreciated.

 
Hi everyone,

I'd like to have a custom message button on my community home page that starts a message thread with a specific user. 
User-added image

So, if a community user clicks the button, the 'New Message' popup should open with the "To" field already filled in with the user I've specified. 

User-added image

I've tried editing the User ID option, but that changes who the message is sent from not who the message is sent to...

User-added image

Is there any way to achieve what I'm trying to do? Is there any way I could create a custom component that launches the standard 'New Message Popup' with the To address filled in?

Is there a standard way to do this that I'm missing? 

My interim is to just take them to the user detail page, where they then have to click the 'Message' button, but I'd like to reduce the clicks. 

Thanks!
Hi everyone,

I'm using the lightning:TreeGrid component and it looks great! One issue I'm facing is that I'd like to change the background color of the <tr> of the current row.

I've set the 'name' of the row to the id of the record, so I know which row I want to change the color of. The component changes give the row a data attribute of data-row-key-value but because of locker service I am unable to access that element with querySelectorAll. From what I've read, the lightning:TreeGrid also doesn't let me add a aura:id to the row.

Does anyone else know of a way I can access a specific row in the Tree Grid? 

Thanks!
I have a community that has been live for about half a year and had used lightning:tabset in the community to replace the generic menu. In my lightning:tab I had added a lightning:icon. As of the most recently release, all of the icons that were originally working, are broken. 

Here's some condensed code:
//The App

<aura:application access="global" extends="force:slds"> <!-- ltng:outApp -->
    <c:PilotConsoleLightingCmp />
</aura:application>  

//The Component 
<aura:component>    
    <lightning:tabset>
            <lightning:tab>
                <aura:set attribute="label">
                    Item One
                    <lightning:icon iconName="action:approval" alternativeText="???"/>
                </aura:set>
            </lightning:tab>
     </lightning:tabset>
</aura:component>

If I move the lightning:icon outside of the tab, it shows up. Otherwise it only shows the alternativeText. 
Any idea how I can get around this or why it's happening? It seems like some functionality is just plain broken to me. 
 
I'm trying to create a custom lightning:picklistPath component for my community. 

I want to use the userId to find the contactId and then find an active service file. My Apex code is working perfectly (I can display the correct service file recordId on my page), but the component still isn't showing up properly. Sometimes it shows up as an empty/grey path, but most times the component doesn't show up at all. 
<aura:component implements="forceCommunity:availableForAllPageTypes,flexipage:availableForAllPageTypes " access="global" controller="PortalController">

    <aura:attribute name="serviceFileId" type="String"/>
	<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

	Service File Id: {!v.serviceFileId} <!--This is correct-->

    <lightning:picklistPath aura:id="picklistPath" recordId="{!v.serviceFileId}"
        variant="non-linear"
        picklistFieldApiName="FileStatus__c"
        >
    </lightning:picklistPath>
</aura:component>

I should have the picklistFieldApiName selected correctly: 
User-added image 
User-added image


In the builder I get this error on page load:
User-added image
I'm entering the contents of the InteractionModel.json file into the JSON Editor in the Amazon Alexa Interaction Model. When I try to save the model with the new code I get the following Error: The interaction model is invalid. Error code: InvalidModelDefinitionSchema

Any idea what could be going wrong? 

User-added image
Hi everyone,

I'd like to have a custom message button on my community home page that starts a message thread with a specific user. 
User-added image

So, if a community user clicks the button, the 'New Message' popup should open with the "To" field already filled in with the user I've specified. 

User-added image

I've tried editing the User ID option, but that changes who the message is sent from not who the message is sent to...

User-added image

Is there any way to achieve what I'm trying to do? Is there any way I could create a custom component that launches the standard 'New Message Popup' with the To address filled in?

Is there a standard way to do this that I'm missing? 

My interim is to just take them to the user detail page, where they then have to click the 'Message' button, but I'd like to reduce the clicks. 

Thanks!
Hi All,

Below is my Code for Importing XML into Salesforce org.

Apex Code: 

public class ImportOppXML {
    

    public Blob myfile{get;set;}

       public ImportOppXML(){

        reports = new List<Opportunity>();

    }

     

    public List<Opportunity> reports {get;set;}

     

    public class Oppdata {

        public String Name {get; set;}

        public Decimal Amount {get; set;}

        public Date CloseDate {get; set;}
        
        public String Description {get; set;}

        public String LeadSource {get; set;}
        
        public String NextStep {get; set;}
        
        public String StageName {get; set;}
        
        public String Type {get; set;}
        
     
    }

 
    private void parseReports(DOM.XMLNode node) {

        for (Dom.XMLNode child : node.getChildElements()) {

            if (child.getName() == 'record') {

                System.debug('child'+child);

                parseReport(child);

                //  reports.add(r);

            }

            System.debug('reports'+reports);

        }

    }

     

    private void parseReport(DOM.XMLNode node ) {

        opportunity r = new opportunity();

         

        for (Dom.XMLNode child : node.getChildElements()) {

            if (child.getName() == 'Name') {

                r.Name= child.getText().trim();

            } else if (child.getName() == 'Amount') {

                r.Amount= child.gettext().trim();

            } else if (child.getName() == 'CloseDate') {

                r.CloseDate= child.getText().trim();

            }  else if (child.getName() == 'Description') {

                r.Description= child.getText().trim();
            
            }  else if (child.getName() == 'LeadSource') {

                r.LeadSource= child.getText().trim();
                 

            }else if (child.getName() == 'NextStep') {

                r.NextStep= child.getText().trim();
                 

            }else if (child.getName() == 'StageName') {

                r.StageName= child.getText().trim();
                
            }else if (child.getName() == 'Type') {

                r.Type= child.getText().trim();
                
                
            
            }
        }

        reports.add(r);

         upsert    reports;

    }

     

    public void doUpload() {

         

        DOM.Document doc = new DOM.Document();

        doc.load(String.valueOf(myfile.toString()));   

        parseReports(doc.getRootElement());

         

         

    }

     

}

User-added image
I have a community that has been live for about half a year and had used lightning:tabset in the community to replace the generic menu. In my lightning:tab I had added a lightning:icon. As of the most recently release, all of the icons that were originally working, are broken. 

Here's some condensed code:
//The App

<aura:application access="global" extends="force:slds"> <!-- ltng:outApp -->
    <c:PilotConsoleLightingCmp />
</aura:application>  

//The Component 
<aura:component>    
    <lightning:tabset>
            <lightning:tab>
                <aura:set attribute="label">
                    Item One
                    <lightning:icon iconName="action:approval" alternativeText="???"/>
                </aura:set>
            </lightning:tab>
     </lightning:tabset>
</aura:component>

If I move the lightning:icon outside of the tab, it shows up. Otherwise it only shows the alternativeText. 
Any idea how I can get around this or why it's happening? It seems like some functionality is just plain broken to me. 
 
I'm trying to create a custom lightning:picklistPath component for my community. 

I want to use the userId to find the contactId and then find an active service file. My Apex code is working perfectly (I can display the correct service file recordId on my page), but the component still isn't showing up properly. Sometimes it shows up as an empty/grey path, but most times the component doesn't show up at all. 
<aura:component implements="forceCommunity:availableForAllPageTypes,flexipage:availableForAllPageTypes " access="global" controller="PortalController">

    <aura:attribute name="serviceFileId" type="String"/>
	<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

	Service File Id: {!v.serviceFileId} <!--This is correct-->

    <lightning:picklistPath aura:id="picklistPath" recordId="{!v.serviceFileId}"
        variant="non-linear"
        picklistFieldApiName="FileStatus__c"
        >
    </lightning:picklistPath>
</aura:component>

I should have the picklistFieldApiName selected correctly: 
User-added image 
User-added image


In the builder I get this error on page load:
User-added image
I'm entering the contents of the InteractionModel.json file into the JSON Editor in the Amazon Alexa Interaction Model. When I try to save the model with the new code I get the following Error: The interaction model is invalid. Error code: InvalidModelDefinitionSchema

Any idea what could be going wrong? 

User-added image