• Debabrata Bera
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
I have following scenario where i have two set of cmp from js. now i want to iterate one cmp under another cmp based on id.

Apex Class Method:
public static ContactListWrapper getContacts(Id recordId) {
        
        List<Contact> contactList=new List<Contact>();
        List<OpportunityContactRole> ocrList;
        List<OpportunityContactRole> ocrListFull=new List<OpportunityContactRole>();
        Opportunity opp = [SELECT AccountId FROM Opportunity where Id =:recordId];
        contactList = [SELECT Id, Name, Email, Phone, MobilePhone From Contact Where AccountId =:opp.AccountId ORDER BY Name]; 
                        
        for(Contact con : contactList) {
           ocrList = [SELECT Id, ContactId, Role, isPrimary from OpportunityContactRole where ContactId =:con.id]; 
            for(OpportunityContactRole ocr : ocrList)
              ocrListFull.add(ocr); 
        }
        return new ContactListWrapper(contactList,ocrListFull);    
    }

in Controller.js-
component.set("v.items", result);

in .cmp-
<tbody>
                <aura:iteration items="{!v.items}" var="item">                    
                    <aura:iteration items="{!item.contactList}" var="con"> --> For Contact record
                        <tr>
                            <td data-label="Name">
                                {!con.Name}
                            </td>                    
                            <td data-label="Phone">
                                <lightning:clickToDial value="{!con.Phone}" />
                            </td>
                            <td data-label="Mobile">
                                <lightning:clickToDial value="{!con.MobilePhone}" />
                            </td>
                            <td data-label="Email">
                                <lightning:formattedEmail value="{!con.Email}" />
                            </td>                            
                            <td data-label="Role">
                                * I want to display Role here which is present in ocrListFull based on contactId of contactList.
                            </td>                                
                        </tr>
                    </aura:iteration>                    
                </aura:iteration>

Please let me know if anyone have suitable solution.
                
I have created custom Contact Role in lightning component where i need button functionality for 'Manage Contact Roles' for the current opportunity.

Please let me know if anyone have answer.
Here is my simple code - 
if(a == component.get("v.recordId")) {
            $A.get("e.force:closeQuickAction").fire();
            window.open('*****');
I am getting redirected to my URL but the empty window is not getting closed automatically.
$A.get('e.force:refreshView').fire();
I am getting error - 'Cannot read property 'fire' of undefined'. This is weired. Plz help me if you have any suitable answer.
I have created custom Contact Role in lightning component where i need button functionality for 'Manage Contact Roles' for the current opportunity.

Please let me know if anyone have answer.
Here is my simple code - 
if(a == component.get("v.recordId")) {
            $A.get("e.force:closeQuickAction").fire();
            window.open('*****');
I am getting redirected to my URL but the empty window is not getting closed automatically.
$A.get('e.force:refreshView').fire();
I am getting error - 'Cannot read property 'fire' of undefined'. This is weired. Plz help me if you have any suitable answer.
Challenge Requirements:
Create a flow:
Name: New Lead
Type: Screen Flow
In the flow, add a screen with these required screen fields.
Last Name
Company Name
In the flow, create a lead record.
Use the screen fields to set the lead’s Last Name and Company.
Store the lead’s ID in a Text variable called leadId.
In the flow, add another screen with a Lightning component screen field.
Name the field Upload_File
Choose the forceContent:fileUpload Lightning component.
Use the leadId variable to set the component's Related Record ID attribute.
Activate the New Lead flow.
Create a new Lightning page:
Type: Home page
Label: Process Automation Home
In Process Automation Home, add a Flow component that references the New Lead flow.
Activate the page and set it as the default Home page.

I did all of this and yet it says it cannot detect force content?User-added image
User-added image
Re-factored my code from previous units with base lightning components, but receiving this error.  Here's my new form component.  Any help would be much appreciated.

<aura:component >   
    <aura:attribute name="newItem" type="Camping_Item__c"    default="{ 'sobjectType': 'Camping_Item__c',
                         'Name': '',
                         'Price__c': 0,
                         'Quantity__c': 0,                         
                         'Packed__c': false
                       }"/>
 
    <aura:registerEvent name="addItem" type="c:addItemEvent"/>
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
<div aria-labelledby="newItemForm">

    <!-- BOXED AREA -->
    <fieldset class="slds-box slds-theme--default slds-container--small">

    <legend id="newItemForm" class="slds-text-heading--small 
      slds-p-vertical--medium">
      Add Camping Item
    </legend>

    <!-- CREATE NEW CAMPING ITEM FORM -->
    <form class="slds-form--stacked">          
        <lightning:input aura:id="itemForm" label="Camping Item Name"
                         name="Name"
                         value="{!v.newItem.Name}"
                         required="true"/> 
        <lightning:input type="number" aura:id="itemForm" label="Quantity"
                         name="Quantity"
                         maxlength="16"
                         min="0"
                         step="1"
                         value="{!v.newItem.Quantity__c}"
                         required="true"/>
        <lightning:input type="number" aura:id="itemForm" label="Price"
                         name="Price"
                         min="0"
                         step=".01"
                         value="{!v.newItem.Price__c}"
                         formatter="currency"
                         messageWhenRangeUnderflow="Enter an amount that's at least .01."/>
        <lightning:input type="checkbox" aura:id="itemForm" label="Packed?"  
                         name="Packed"
                         checked="{!v.newItem.Packed__c}"/>
        <lightning:button label="Create Expense" 
                          class="slds-m-top--medium"
                          variant="brand"
                          onclick="{!c.clickCreateItem}"/>
    </form>
  </fieldset>
  <!-- / BOXED AREA -->

</div>
        </lightning:layoutItem>
    </lightning:layout>
</aura:component>