You need to sign in to do that
Don't have an account?
MilesS
aura lwc that imports table from apex method based on active record from communities page
How to I run a class when a communities page is opened for the active recod? I want to replace the hard coded values with what is on the Invoice Item record that the user will be viewing. I'm not sure where the .js goes (helper, controller, or Render). Any suggestions/solutions are truely appreciated and thank you in advance.
I have looked at this, but it doesn't seem to be the same setup as the aura lwc. https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_wire_method
Component
APEX Class
I have looked at this, but it doesn't seem to be the same setup as the aura lwc. https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_wire_method
Component
<aura:component implements="force:lightningQuickAction,force:hasRecordId"> <p class="h1">Invoice Detail</p> <table> <colgroup> <col span="1" style="width:60%"/> <col span="1" style="width:40%" /> </colgroup> <tbody class="invGroup"> <td> <table> <thead class="columnHeader"> <th><div class="slds-truncate" title="Statement Date">Statement Date</div></th> <th>Status</th> <th>Invoice #</th> </thead> <tbody> <tr class="columndetail"> <td>{!v.recordId}</td> <td>Open Invoice</td> <td>{!v.Invoice_number__c}</td> </tr> </tbody> </table> </td> <td> <table> <thead> <th class="column4" style="color:rgb(0,160,221);font-weight: bold;">Description</th> <th class="column5" style="color:rgb(0,160,221);font-weight: bold;">Amount</th> </thead> <tbody class="columndetail"> <tr> <td>Dark Fiber</td> <td>$4,899.00</td> </tr> <tr> <td>State Sales Tax</td> <td>$100.00</td> </tr> <tr> <td>City Tax</td> <td>$100.00</td> </tr> <tr> <td>Regulatory Fee</td> <td>$1.00</td> </tr> <tr class="subTotal"> <td>Sub-Total</td> <td>$5,100.00</td> </tr> </tbody> </table> </td> </tbody> </table> </aura:component>Style (CSS)
.THIS .invGroup{ vertical-align: top; border-style: solid solid solid solid; border-width: 1px; } .THIS .columnHeader{ font-family: Century Gothic, sans-serif; font-size: 15px; text-align:left; vertical-align: top; color:rgb(0,160,221);font-weight: bold; } .THIS .columndetail{ font-family: Century Gothic, sans-serif; font-size: 15px; text-align:left; vertical-align: top; color:rgb(52,62,72); } .THIS .subTotal{ font-family: Century Gothic, sans-serif; font-size: 15px; text-align:left; color:rgb(52,62,72); font-weight: bold; border-style: solid none none none; border-width: 1px; } .THIS .h1{ font-family: Century Gothic, sans-serif; font-size: 30px; text-align:left; color:rgb(0,160,221); font-weight: bold; }
APEX Class
public class apexCls_InvoiceDetails { @AuraEnabled(cacheable=true) public static List<Invoice_Item__c> InvoiceDetails(string RecordId){ Invoice_Item__c[] returnInvItmList = new List<Invoice_Item__c>(); for(Invoice_Item__c InvItem : [SELECT Account_number__c,Account_Name__c,Billing_Street_Address__c,Billing_City_State_Zip__c, Invoice_number__c,Status__c,Statement_Date__c,Due_Date__c, Description__c,Amount__c FROM Invoice_Item__c WHERE Id=:RecordId]){ if(InvItem.status__c != 'Paid'){ returnInvItmList.add(InvItem); } } system.debug('Final Return List: '+returnInvItmList); return returnInvItmList; } }