You need to sign in to do that
Don't have an account?
Sophia G
Help with changing a line on a list class in apex code
Hi,
I am pretty new to coding and just need help on adding/changing the following line in my apex code so it queries the RecordTypeId as well as the OpportunityId from the record that my lightning component button has been actioned from. This RecordType which has the lightning component button is called 'Master PAX' and the RecordTypeId is 0121U000000VqrB. At the moment I have just manually added in the OpportunityId of my Master PAX and all the code is working great, I just need it to populate the OpportunityId and RecordTypeId automatically.
I have been stuck on this for a while and help would be much appreciated.
I am pretty new to coding and just need help on adding/changing the following line in my apex code so it queries the RecordTypeId as well as the OpportunityId from the record that my lightning component button has been actioned from. This RecordType which has the lightning component button is called 'Master PAX' and the RecordTypeId is 0121U000000VqrB. At the moment I have just manually added in the OpportunityId of my Master PAX and all the code is working great, I just need it to populate the OpportunityId and RecordTypeId automatically.
List<Quote> lstQuoteResult = new List<Quote>(); List<Quote> lstQuote = [SELECT Id, OwnerId, IsDeleted, Name, CurrencyIsoCode, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, LastViewedDate, LastReferencedDate, OpportunityId, Pricebook2Id, ContactId, QuoteNumber, IsSyncing, ShippingHandling, Tax, Status, ExpirationDate, Description, Subtotal, TotalPrice, LineItemCount, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, BillingLatitude, BillingLongitude, BillingGeocodeAccuracy, BillingAddress, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode, ShippingCountry, ShippingLatitude, ShippingLongitude, ShippingGeocodeAccuracy, ShippingAddress, QuoteToStreet, QuoteToCity, QuoteToState, QuoteToPostalCode, QuoteToCountry, QuoteToLatitude, QuoteToLongitude, QuoteToGeocodeAccuracy, QuoteToAddress, AdditionalStreet, AdditionalCity, AdditionalState, AdditionalPostalCode, AdditionalCountry, AdditionalLatitude, AdditionalLongitude, AdditionalGeocodeAccuracy, AdditionalAddress, BillingName, ShippingName, QuoteToName, AdditionalName, Email, Phone, Fax, ContractId, AccountId, Discount, GrandTotal, CanCreateQuoteLineItems, Airline__c, Milestone__c, Milest__c, Milestone_Deposit_Date__c, Final_Deposit_Balance_Due__c, FInal_Deposit_Balance_Amount__c, Start_Date__c, Product_Interested_In__c, Check_In_Date__c, Check_Out_Date__c, Old_Quote__c, Price_Book_Name__c, Sent_to_Customer_Date__c, Price_Per_Person__c, Airfare_Required__c, Airfare_Amount__c, Insurance_Required__c, Insurance_Amount__c, Misc_Add_On__c, Misc_Add_On_Price__c, Overall_Grand_Total__c, Discount_Applied__c, Per_Person__c, Quotation_Total__c, Amount__c, Departing__c, Arrival__c, Departure_Date__c, Arrival_Date__c, Flight__c, Flight_Details__c, Insurance_From__c, Insurance_To__c, Number_of_Nights__c, Misc_Add_On_Required__c, Passenger_Names__c, Checkout_checkin__c, Final_Payment_Due_Date__c FROM Quote WHERE OpportunityId = :'0065500000HMAr5AAH'];
I have been stuck on this for a while and help would be much appreciated.
Hi Sophia,
you should replace the Custom ID with opportunityId variable. If you don't understand then show me your whole apex class or Lightning component.
I will try to fix your issue.
Thank you
Thank you for your replying. I am still having trouble with this - could you please give me a hand. Below is my Component, Controller, and Apex. Many thanks!
Component:
Controller: Apex:
Application: