• Andrew McAllister
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I am adding a button that opens a modal window to add a task to a specific "Objective".  There is an add Task button next to every "Objective" that is displayed, but I'm not sure how I can pull the record Id of the specific objective the button sits next to so I can set the WhatId field of the task to that specific objective... Any ideas here? 

Thanks in advance.
 
<aura:iteration items="{!v.objectives}" var="obj" >


        	<div class="blacklink slds-col slds-size_11-of-12 slds-text-body_regular slds-m-bottom_small slds-box">
                	<a class ="blacklink" href="{!'/lightning/r/Task/'+ obj.Id + '/view'}" target="_blank">	{!obj.Description__c} </a>
            </div>
            <div id ="obj.Id" class="slds-size_1-of-12 slds-m-top_x-small slds-p-left_large">
                	<lightning:button label="+Task" class="slds-button slds-text-body_regular" onclick="{!c.taskopenmodal}" name="obj.Id"/>
                
			</div>
            
            	
                        <aura:if isTrue="{!obj.Tasks}">
                    	<div class="slds-col slds-size_3-of-5 slds-p-left_xx-large slds-m-bottom_small slds-text-heading_small slds-border_bottom" >
                            Task Subject
						</div>
                		<div class="slds-col slds-size_1-of-5 slds-m-bottom_small slds-text-heading_small slds-border_bottom">
                			Status
                		</div>
                		<div class="slds-col slds-size_1-of-5 slds-m-bottom_small slds-text-heading_small slds-border_bottom">
                			Owner
                		</div>
          				</aura:if>
                    
            <aura:iteration items="{!obj.Tasks}" var="t" >
                       	<div class="slds-col slds-size_3-of-5 slds-p-left_xx-large slds-m-bottom_small" >
                            <a href="{!'/lightning/r/Task/'+ t.Id + '/view'}" target="_blank">
                            {!t.Subject} 
                            </a>
						</div>
                		<div class="slds-col slds-size_1-of-5 slds-m-bottom_small">
                			{!t.Status}
                		</div>
                		<div class="slds-col slds-size_1-of-5 slds-m-bottom_small">
                			{!t.Owner.Name}
                		</div>
            </aura:iteration> 
            
         </aura:iteration>

 
I'm very new to lightning components and also development in general...

I'm working on creating a lightning component that displays Account Partners. I am getting a list of AccountPartner records and want to display the account names instead of the ID from AccountToId field. 

Is there a way to get and display the name of the account without running another SOQL query?
 
<aura:iteration items="{!v.partners}" var="partner">

<-- This is working, but only shows Id-->
{! partner.AccountToId}


<!-- Doesn't work...
{! partner.AccountToId.Name} -->


 </aura:iteration>


Hope this makes sense.


Thanks
I am adding a button that opens a modal window to add a task to a specific "Objective".  There is an add Task button next to every "Objective" that is displayed, but I'm not sure how I can pull the record Id of the specific objective the button sits next to so I can set the WhatId field of the task to that specific objective... Any ideas here? 

Thanks in advance.
 
<aura:iteration items="{!v.objectives}" var="obj" >


        	<div class="blacklink slds-col slds-size_11-of-12 slds-text-body_regular slds-m-bottom_small slds-box">
                	<a class ="blacklink" href="{!'/lightning/r/Task/'+ obj.Id + '/view'}" target="_blank">	{!obj.Description__c} </a>
            </div>
            <div id ="obj.Id" class="slds-size_1-of-12 slds-m-top_x-small slds-p-left_large">
                	<lightning:button label="+Task" class="slds-button slds-text-body_regular" onclick="{!c.taskopenmodal}" name="obj.Id"/>
                
			</div>
            
            	
                        <aura:if isTrue="{!obj.Tasks}">
                    	<div class="slds-col slds-size_3-of-5 slds-p-left_xx-large slds-m-bottom_small slds-text-heading_small slds-border_bottom" >
                            Task Subject
						</div>
                		<div class="slds-col slds-size_1-of-5 slds-m-bottom_small slds-text-heading_small slds-border_bottom">
                			Status
                		</div>
                		<div class="slds-col slds-size_1-of-5 slds-m-bottom_small slds-text-heading_small slds-border_bottom">
                			Owner
                		</div>
          				</aura:if>
                    
            <aura:iteration items="{!obj.Tasks}" var="t" >
                       	<div class="slds-col slds-size_3-of-5 slds-p-left_xx-large slds-m-bottom_small" >
                            <a href="{!'/lightning/r/Task/'+ t.Id + '/view'}" target="_blank">
                            {!t.Subject} 
                            </a>
						</div>
                		<div class="slds-col slds-size_1-of-5 slds-m-bottom_small">
                			{!t.Status}
                		</div>
                		<div class="slds-col slds-size_1-of-5 slds-m-bottom_small">
                			{!t.Owner.Name}
                		</div>
            </aura:iteration> 
            
         </aura:iteration>

 
I'm very new to lightning components and also development in general...

I'm working on creating a lightning component that displays Account Partners. I am getting a list of AccountPartner records and want to display the account names instead of the ID from AccountToId field. 

Is there a way to get and display the name of the account without running another SOQL query?
 
<aura:iteration items="{!v.partners}" var="partner">

<-- This is working, but only shows Id-->
{! partner.AccountToId}


<!-- Doesn't work...
{! partner.AccountToId.Name} -->


 </aura:iteration>


Hope this makes sense.


Thanks