function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sarvajna prabhuSarvajna prabhu 

pass record id one component from another component

Best Answer chosen by Sarvajna prabhu
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Prabhu,

Please check the code below.
<aura:component controller="ActionController"  implements="force:hasRecordId,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:lightningQuickAction" access="global">
    <aura:attribute name="theId" type="String"/>
    <aura:attribute name="options" type="String[]"/>
    <aura:attribute name="wrplst" type="WrapperCriteria[]"/>
    <aura:attribute name="selectedValue" type="String"/>
    <aura:handler name="deleteJob" event="c:deleteJobEvt" action="{!c.RemoveClick}" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <p>
       <b>Creating Action Criteria </b>
    </p>
    <h3 class="slds-section-title--divider">
       <b>
           <I> Action Criteria</I>
       </b>
    </h3>
    <table >
        <tr class="slds-text-title--caps">
           <th class="head">
               <I>Action</I>
           </th>
           <th class="head">
               <I>Object Name</I>
           </th>
           <th class="head">
               <I>Component</I>
           </th>
           <th class="head">
               <I>Operator</I>
           </th>
           <th class="head">
               <I>Special Operator</I>
           </th>
           <th class="head">
               <I>Special Operator * Value</I>
           </th>
           <th class="head">
               <I>Special Operator / Value</I>
           </th>
     </tr>
     <aura:renderIf isTrue="{!v.wrplst.length > 0}">
        <c:NewAction options="{!v.options}" selectedValue="" />
        <aura:iteration items="{!v.wrplst}" var="a">
            <c:NewAction wrp="{!a}"/>
         </aura:iteration>
     </aura:renderIf>
</table>
<lightning:button variant="brand" label="Add row" onclick="{!c.AddRow}" />
<lightning:button variant="brand"  label="Save" onclick="{!c.saveRow}" />
 
<aura:component controller="ActionController" >
    <aura:attribute name="wrp" type="WrapperCriteria[]"/>
    <aura:attribute name="idval" type="String"/>
    <aura:attribute required="true" name="options" type="String[]"/>
    <aura:attribute required="true" name="selectedValue" type="String"/>
    <aura:attribute name="wpchange" type="List" />
    <aura:registerEvent name="deleteJob" type="c:deleteJobEvt"/>

    <tr>
        <td class="cell" style="padding-top:14px;padding-bottom:0px;">
           <p >
              <button type="button" onclick="{!c.RemoveClick}" >remove</button>
           </p>
       </td>
       <td class="cell" >
           <p>
               <lightning:select name="mySelect" label=" " value="{!v.selectedValue}" onchange="{!c.dosomething}">
                    <aura:iteration items="{!v.options}" var="item">
                        <option text="{!item.label}" value="{!item.value}" selected="{!item.selected}"/>
                    </aura:iteration>
               </lightning:select> 
           </p>
      </td>
      <td class="cell" >
           <lightning:select name="select" label=" " aura:id="o" >
                <option value="">None</option>
           </lightning:select>
       </td>
       <td class="cell" >
           <p>
               <lightning:select name="selectItem" label=" ">
                   <option value="None">None</option>
                   <option value="+ Addition">+ Addition</option>
                   <option value="- Subtract  ">- Subtract</option>
                   <option value="* Multiply ">* Multiply</option>
                   <option value="/ Divide">/ Divide</option>
               </lightning:select>
           </p>
      </td>
      <td class="cell" >
          <p>
              <lightning:select name="selectItem" label=" " >
                  <option value="None">None</option>
                  <option value="*">*</option>
                  <option value="*/">*/</option>
                  <option value="/">/</option>
              </lightning:select>
          </p>
      </td>
      <td class="cell"  style="padding-top:14px;padding-bottom:0px;">
          <p>
              <ui:inputText value="{!v.wrp.specialOperatorValue}"/>
          </p>
      </td>
      <td class="cell"  style="padding-top:14px;padding-bottom:0px;">
          <p>
              <ui:inputText value="{!v.wrp.specialOperatorSlashValue}"/>
          </p>
      </td>
  </tr>
For this, I have created an attribute:

<aura:attribute name="idval" type="String"/>

use this to pass id to NewAction like below:

<c:NewAction options="{!v.options}" selectedValue="" idva

Hope it will be helpful.

Thanks
Rahul Kumar