You need to sign in to do that
Don't have an account?

A List Exception, Query Returning 0 Records
I am getting an exception because one of my queries is not returning results, I'm not sure why, can you take a look?
This is the line that's causing the problem: List<Quote> Synced = [SELECT Synced_Quote_Id__c FROM Quote WHERE Id = :quotelid[0].Id];
Here's the rest of the code, if that helps. Thanks!
trigger SyncdQuoteUpdate onMilestone1_Project__c (beforeinsert, beforeupdate) {
Id INVLI = trigger.new[0].Invoice_Line_Item__c;
String SyncedQuote = trigger.new[0].Synced_Quote__c;
Date breakdate = Date.newinstance(2012, 7, 8);
Date CreationDate = trigger.new[0].Created_Date__c;
System.Debug(INVLI);
List<QuoteLineItem> quotelid = [SELECT QuoteId FROM QuoteLineItem WHERE Id = :INVLI];
List<Quote> Synced = [SELECT Synced_Quote_Id__c FROM Quote WHERE Id = :quotelid[0].Id];
if ( CreationDate > breakdate ) {
if (SyncedQuote == null) {
trigger.new[0].Synced_Quote__c = Synced[0].Id;
}
}
}
In a Quote query you are using "quotelid[0].Id" which is an Id of a QuoteLineItem not a Quote.
You probably wanted to use "quotelid[0].QuoteId".
All Answers
In a Quote query you are using "quotelid[0].Id" which is an Id of a QuoteLineItem not a Quote.
You probably wanted to use "quotelid[0].QuoteId".
Thank you kindly!