0

I have built lightning component where user can make decision of records like Approve/Reject/NMI. That's working fine.now i am trying to do if record is Approve i want to show some Indication to that record that its approved(here i am not refreshing my component.)

This action he will done by clicking on lightning icon one modal popup will open.there he will fill details and click on Submit. Modal will close. after that i want to show as Approved for that particular <td>. I am posting my code which i have done.

Component

 <aura:if isTrue="{!v.isApproveOpen}">
  <div role="dialog" tabindex="-1" aria-labelledby="header99" class="slds-modal slds-fade-in-open ">
    <div class="slds-modal__container">
        <div class="slds-modal__header">
        <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{!c.closeapproveModel}">
        <span class="slds-assistive-text">Close</span>
        </button>
        <h2 id="header99" class="slds-text-heading--medium">Approve</h2>
      </div>  
     <div class="slds-modal__content slds-p-around--medium">
        <form>                    
            <!--<lightning:select name="mySelect" label="First Filing Country" aura:id="mySelect1" value="{!v.selectedValue}" onchange="{!c.onchange}" >
                <aura:iteration items="{!v.options}" var="item">
                    <option value="{!item.Id}" text="{!item.label}" selected="{!item.selected}"/>
                </aura:iteration>
            </lightning:select>-->
            <lightning:select name="FirstCon" aura:id="FirstCon" label="First Filing Country" value="{!v.selectedValue}" onchange="{!c.loadcountrys}">
                <option value="">-- None --</option>
                <aura:iteration items="{!v.mycountry}" var="conlist">
                    <option value="{!conlist.Id}" text="{!conlist.Name}"></option>
                </aura:iteration>
            </lightning:select>
            <ui:inputTextArea aura:id="filingtype" label="Filing Type" rows="1" value="{!v.casepick}"/>
            <ui:inputTextArea aura:id="instructionforcase" label="Instructions For Case" rows="2" value="{!v.insforcase}"/>
            <ui:inputTextArea aura:id="instructionforoc" label="Instructions For OC" rows="2" value="{!v.insforoc}"/>
            <ui:inputDate aura:id="targetdate" label="Target Filing Date" displayDatePicker="true" value="{!v.targdate}"/>
            <lightning:select name="ddlLawfirm" aura:id="ddlLawfirm" label="Select Law Firm" value="{!v.selectedlawfim}" onchange="{!c.loadOCs}">
                <option value="">-- None --</option>
                <aura:iteration items="{!v.optLawfirms}" var="optLawfirm">
                    <option value="{!optLawfirm.Id}" text="{!optLawfirm.Name}"></option>
                </aura:iteration>
            </lightning:select>

            <lightning:select name="ddlOutsideCounsel" aura:id="ddlOutsideCounsel" label="Select Outside Counsel" value="{!v.selectedOC}" onchange="{!c.setSelectedOC}" >
                <option value="">-- None --</option>
                <aura:iteration items="{!v.optOCs}" var="optOC">
                    <option value="{!optOC.Id}" text="{!optOC.Name}"></option>
                </aura:iteration>
            </lightning:select>             
        </form>
     </div>
       <div class="slds-modal__footer">
        <button class="slds-button slds-button--neutral" onclick="{!c.closeapproveModel}" >Cancel</button>
        <button class="slds-button slds-button--brand" onclick="{!c.Approvecomment}">Submit</button>
      </div>
    </div>
  </div>
  <div class="slds-backdrop slds-backdrop--open"></div>
  </aura:if>

Icon:

 <td scope="row">
             <lightning:buttonIcon iconName="utility:check" variant="bare" onclick="{!c.openapproveModel}" alternativeText="Approve"/>                
             <lightning:buttonIcon iconName="utility:close" variant="bare" onclick="{!c.openrejModel}" alternativeText="Recject" />
             <lightning:buttonIcon iconName="utility:info" variant="bare" onclick="{!c.openNMIModel}" alternativeText="Need More Information" />                 
           </td>

how to get this. Is they any workaround please suggest me.

Thanks

1 Answer 1

1

Do you have any Approval process for this? if yes- Please use below SOQL
Select ID, Status, ProcessDefinition.Developername, TargetObjectID From ProcessInstance Where TargetObjectID = :<Record Id> AND Status = 'Pending' AND ProcessDefinition.Developername=: <Approval process Name>
if above Query doesn't return any row It means Record is Approved and You can show/hide any component.

3
  • No Rohit. I am doing this by Flow and my component will not get refresh. to get data from Query.
    – Jay
    Jun 8, 2018 at 7:52
  • Can you help me to understand what exactly are you trying to do in detail?
    – RKM
    Jun 8, 2018 at 9:35
  • I want to show a color indication for record which i have made approve
    – Jay
    Jun 8, 2018 at 11:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.