You need to sign in to do that
Don't have an account?
Abhishek Sharma 527
Wrapper class apex
Hello Developers, I have apex class which consists of 2 queries and I want to merge it inside wrapper class.
here's my class
here's my class
public class NonBillableReport { @AuraEnabled public static List<Event> getNonBillable(){ List<Event> nonBill = [Select Subject, Id, Facilities__c, Services__c, Appointment_Status__c, OwnerId, WhoId, ActivityDateTime, ActivityDate, WhatId, Facilities__r.Address_1__c,Facilities__r.City__c, Facilities__r.Name,Facilities__r.Country__c, Sup_Provider__c,Sup_Provider__r.Name, Owner.FirstName, Owner.MiddleName, Owner.LastName, EndDateTime, Facilities__r.State__c, Sup_Provider__r.Provider_Role__c FROM Event WHERE IsRecurrence = false AND Appointment_Status__c = 'Non-Billable' LIMIT 100]; return nonBill; List<Session> SessionRecords = [Select Case_Number__c,Case_Number__r.Client_Insurance__c, Case_Number__r.Total_Amounts__c,Case_Number__r.Client_Insurance__r.Insurance_Type__c,Case_Number__r.Client_Insurance__r.Insured_ID__c, Client_Name__c,Case_Number__r.Patient_Customer__r.Client_ID__c,Case_Number__r.Patient_Customer__r.DOB__c,Insurance_Name__c, Case_Number__r.InsuranceType__c,Case_Number__r.Claim_ID__c,Case_Number__r.Insurance__r.Payer_Id__c,Case_Number__r.Insurance__r.Name,From_DOS__c,Case_Number__r.Location_Name__c,Case_Number__r.Facility_Type__c,Case_Number__r.Provider_Name__c,Case_Number__r.Provider__c, Case_Number__r.Authorization_Number__c, Authorization_Number__c,Case_Number__r.CaseNumber , Procedure_Code__c,Modifier1__r.Name,Modifier2__r.Name,Modifier3__r.Name,Modifier4__r.Name ,Unit_Count__c, Case_Number__r.Billed_Amount__c, Practice_Fee__c,Case_Number__r.Status,Case_Number__r.First_Bill_Date__c,Case_Number__r.Last_Bill_Date__c, ICD_Code__c, NDC_Code__c,NDC_Unit_Price__c,Unit_of_Measure__c,Case_Number__r.Unit__c,Case_Number__r.FacilitiesV3__c, Audit_Status__c,lastModifiedBy.Name, lastModifiedDate,PracticeFee__c FROM Case_Line_Item__c limit 10]; } }Please help me or suggest if something is incorrect
If you find this answer helpful, Please mark it as the best answer.
All Answers
- Avoid using unnecessary fields in SOQL query and same is applicable for wrapper class.
- Build a wrapper class with all valid error handlers.
use this link as a reference for creating a wrapper class: https://www.sfdcpoint.com/salesforce/wrapper-class-in-lwc/Best Regards
Gulshan Raj
If you find this answer helpful, Please mark it as the best answer.