• Robert Gallahue
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 4
    Replies
I am struggling to pass a attribute value from a parent component (Lookupclean) to a child component (flowFooter). I am trying to pass the value to the child component in order to validate that a value has been entered in a field. The parent component is a lookup field (necessary with flow) and the child component is a footer bar. The idea is that the next button wont fire unless a value is entered. However i can not seem to pass the value from Parent to Child. 

Parent Component (LookupClean):
Component
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:availableForFlowScreens">
   
    <aura:attribute name="object" type="String" default="Offers__c" access="public"></aura:attribute>
    <aura:attribute name="lookupField" type="String" default="Opportunity__c" access="public"></aura:attribute>
    <aura:attribute name="selectedRecordId" type="String" access="public"></aura:attribute>
    <aura:attribute name="parentAttribute" type="String" default='test'></aura:attribute>
    <c:flowFooter childAttribute="{!v.parentAttribute}"/>
  
    <lightning:recordEditForm objectApiName="{! v.object }">
    	<lightning:inputField fieldName="{! v.lookupField }" aura:id="field" onchange="{! c.handleOnChange }"/>
    </lightning:recordEditForm>
       
</aura:component>
Controller
({
    handleOnChange : function(component, event, helper) {
        component.set( "v.selectedRecordId", event.getParams( "fields" ).value );
         var ally = component.find("field").get("v.value");
        console.log(ally);
        component.set("v.parentAttribute",ally); 
        console.log(component.get("v.parentAttribute"));
    }
})
Design
<design:component>
    <design:attribute name="object" />
    <design:attribute name="lookupField" />
    <design:attribute name="selectedRecordId" />
</design:component>

Child Component
<aura:component access="global" implements="lightning:availableForFlowScreens">
        
   <!-- Determine which actions are available -->
   <aura:attribute name="canPause" type="Boolean" />
   <aura:attribute name="canBack" type="Boolean" />
   <aura:attribute name="canNext" type="Boolean" />
   <aura:attribute name="canFinish" type="Boolean" />
   <aura:attribute name="childAttribute" type="String" />
   <aura:handler name="init" value="{!this}" action="{!c.init}" />
   
        
   <div aura:id="actionButtonBar" class="slds-clearfix slds-p-top_medium">
      <!-- If Previous is available, display to the left -->
      <div class="slds-float_left">
         <aura:if isTrue="{!v.canBack}">
            <lightning:button aura:id="BACK" label="Previous"
               variant="neutral" onclick="{!c.onButtonPressed}" />
         </aura:if>
      </div>
      <div class="slds-float_right">
         <!-- If Pause, Next, or Finish are available, display to the right -->
         <aura:if isTrue="{!v.canPause}">
            <lightning:button aura:id="PAUSE" label="Pause"
               variant="neutral" onclick="{!c.onButtonPressed}" />
         </aura:if>
         <aura:if isTrue="{!v.canNext}">
            <lightning:button aura:id="NEXT" label="Next" 
               variant="brand" onclick="{!c.onButtonPressed}" />
         </aura:if>
         <aura:if isTrue="{!v.canFinish}">
            <lightning:button aura:id="FINISH" label="Done"
               variant="brand" onclick="{!c.onButtonPressed}" />
         </aura:if>
      </div>
   </div>
</aura:component>
Controller
 
({
   init : function(cmp, event, helper) {
      // Figure out which buttons to display
      var availableActions = cmp.get('v.availableActions');
      for (var i = 0; i < availableActions.length; i++) {
         if (availableActions[i] == "PAUSE") {
            cmp.set("v.canPause", true);
         } else if (availableActions[i] == "BACK") {
            cmp.set("v.canBack", true);
         } else if (availableActions[i] == "NEXT") {
            cmp.set("v.canNext", true);
         } else if (availableActions[i] == "FINISH") {
            cmp.set("v.canFinish", true);
         }
      }
   },
           
   onButtonPressed: function(cmp, event, helper) {
       var label = cmp.get("v.childAttribute");
 	   var isDefined = !$A.util.isUndefined(cmp.get("v.childAttribute"));
       console.log(isDefined);
       console.log(label);
          
         if (label) {
             // Figure out which action was called
      	     var actionClicked
 = event.getSource().getLocalId();
      	     // Fire that action
     		 var navigate = cmp.get('v.navigateFlow');
      		 navigate(actionClicked);
         } else {
             alert('Last One 10000');
         }
     }
     

})
User-added image
here is a screenshot showing the two console logs on my Lookupclean after the field is filled

User-added imageHere is a screenshot showing the two additional console.logs when i press my flowFooter button. the attribute is undefined

Any ideas?
Having an issue getting the Record Ids of the selected record in Lightning Datatable. 

Here is my controller
<aura:component implements="lightning:availableForFlowScreens" access="global">
    
    <!-- attributes -->
    <aura:attribute name="dataArr" type="String[]"/>
    <aura:attribute name="data" type="Object"/>
    <aura:attribute name="columnsStr" type="String"/>
    <aura:attribute name="columns" type="List"/>
    <aura:attribute name="maxRowSelection" type="Integer" default="1"/>
    <aura:attribute name="numOfRowsSelected" type="Integer" default="0"/>
    <aura:attribute name="key" type="String" default="Id"/>
    <aura:attribute name="recordId" type="String" />
    <aura:attribute name="recordIds" type="String" />
    
    <!-- handlers-->
    <aura:handler name="init" value="{!this }" action="{! c.doInit }"/>
	
    
    
    <div style="height: 300px">
        <lightning:datatable keyField="{!v.key}"
                data="{! v.data }"
                columns="{! v.columns }"
                maxRowSelection="{! v.maxRowSelection }"
            	onrowselection="{! c.setRecordId }"
                 />
    </div>
	
</aura:component>

and here is my setRecordId function
 
setRecordId : function(component, event, helper){
      
        var selectedRows = event.getParam('selectedRows');
        var key = component.get('v.key');
        var recIds = '';
        console.log(selectedRows);
        if(selectedRows){
            if(selectedRows.length === 1){
                console.log(selectedRows.id)
                console.log(selectedRows[key])
                console.log(selectedRows[0][key])
                component.set('v.recordId', selectedRows[0][key]);
            }
            else{
                for(let i = 0; i < selectedRows.length; i++){
                    recIds += selectedRows[i][key] + ',';
                }
                component.set('v.recordIds', recIds);
                component.set('v.numOfRowsSelected', selectedRows.length);
            }
        }
    },

Var selectedRows returns the correct selected row as an object within an array but i can't seem to find the correct syntax to access that records ID for some reason. Let me know if any additional information is needed here.
appreciate the help
Didn't expect to get hung up on this but I can not find the answer to this question. I created a Process Builder that updates a related record field (on the Opportunity object) when a record is created (Case Materials custom object) and when a specific field on the Case Materials object is changed. By setting it up to have it update when the field is changed i can't seem to also get it to update when the record is created. Any ideas on this oneUser-added imageUser-added imageUser-added imageUser-added image
Hi All,
Lightning migration assistant does not appear in the setup list as it is shown in the Trailblazer posts.

We are still in Classic in the main Org but are in the process of transitioning to Lightning so i have been working in a Sandbox trying to faciliatate that. I switched myself into lightning 30 days ago but just refreshed the Sandbox today and it is back in Classic. I went to find the lightning migration assistant but it is not there and i can not seem to figure out how to switch into Lightning. 

I am a Salesforce Administrator so i dont have the "Modify All Data" permission but i do have the "Lightning Experiance User" permission that others have mentioned is needed to switch the org into lightning.

Any help would be greatly appeciated!

User-added image
Hi All,
i wrote a quick formula in order to sort a list view based upon multiple fields. It returns a number and works great but i'd prefer to not have it show within the list view itself as it is just a bunch of numbers. Is there anyway to hide this but still sort based upon this "sort field"? I've tried Hyperlinking but it needs a text field as an input and does not work sort wise if i wrap the Sort Field API in TEXT

for Example, HYPERLINK(TEXT(Sort__c,"")
- this would just hide the number sort field behind blank text but unfortunately it not longer works

My preference would be to just have the field be completely hidden but that doesnt seem possible
Hi All,
I'm still getting familiar with Salesforce and all thats possible (and not). I've built a few websites so know CSS to some degree but am looking to potentially override some of the CSS in the Salesforce Lightning List component, specifically conditionally format records with a bolded border that have not yet been related to an opportunity. I've come across Community Builder but that doesnt seem to be what i am looking for. I want to avoid building a custom component as i can institute all the needed functionality except this for my list view component but might try going the programmatic route just to expand my skills. Anyways does anyone know of how to potentially access the CSS for the list view lightning component or ways to go about implementing this
thanks!
Hi All,
I'm trying to create a flow in a Sandbox and the "New Flow" button does no show up. This is a full sandbox (unlimited edition) and it is transitioned to Lightning (the standard org. is still classic). Not sure why this button is not appearing for me. Button works fine in my Trailhead Playground

User-added image
Having an issue getting the Record Ids of the selected record in Lightning Datatable. 

Here is my controller
<aura:component implements="lightning:availableForFlowScreens" access="global">
    
    <!-- attributes -->
    <aura:attribute name="dataArr" type="String[]"/>
    <aura:attribute name="data" type="Object"/>
    <aura:attribute name="columnsStr" type="String"/>
    <aura:attribute name="columns" type="List"/>
    <aura:attribute name="maxRowSelection" type="Integer" default="1"/>
    <aura:attribute name="numOfRowsSelected" type="Integer" default="0"/>
    <aura:attribute name="key" type="String" default="Id"/>
    <aura:attribute name="recordId" type="String" />
    <aura:attribute name="recordIds" type="String" />
    
    <!-- handlers-->
    <aura:handler name="init" value="{!this }" action="{! c.doInit }"/>
	
    
    
    <div style="height: 300px">
        <lightning:datatable keyField="{!v.key}"
                data="{! v.data }"
                columns="{! v.columns }"
                maxRowSelection="{! v.maxRowSelection }"
            	onrowselection="{! c.setRecordId }"
                 />
    </div>
	
</aura:component>

and here is my setRecordId function
 
setRecordId : function(component, event, helper){
      
        var selectedRows = event.getParam('selectedRows');
        var key = component.get('v.key');
        var recIds = '';
        console.log(selectedRows);
        if(selectedRows){
            if(selectedRows.length === 1){
                console.log(selectedRows.id)
                console.log(selectedRows[key])
                console.log(selectedRows[0][key])
                component.set('v.recordId', selectedRows[0][key]);
            }
            else{
                for(let i = 0; i < selectedRows.length; i++){
                    recIds += selectedRows[i][key] + ',';
                }
                component.set('v.recordIds', recIds);
                component.set('v.numOfRowsSelected', selectedRows.length);
            }
        }
    },

Var selectedRows returns the correct selected row as an object within an array but i can't seem to find the correct syntax to access that records ID for some reason. Let me know if any additional information is needed here.
appreciate the help
Hi All,
Lightning migration assistant does not appear in the setup list as it is shown in the Trailblazer posts.

We are still in Classic in the main Org but are in the process of transitioning to Lightning so i have been working in a Sandbox trying to faciliatate that. I switched myself into lightning 30 days ago but just refreshed the Sandbox today and it is back in Classic. I went to find the lightning migration assistant but it is not there and i can not seem to figure out how to switch into Lightning. 

I am a Salesforce Administrator so i dont have the "Modify All Data" permission but i do have the "Lightning Experiance User" permission that others have mentioned is needed to switch the org into lightning.

Any help would be greatly appeciated!

User-added image