You need to sign in to do that
Don't have an account?
Melissa Mueller 9
Variable is initialized and not out of scope, but I get error saying the variable does not exist
In the following code I get the error: 'Variable does not exist: synchedDates'
From what I am seeing, the list variable synchedDates is initialized and not out of scope. This error occurs in both the Salesforce Developer Console as well as Oracle.
Even crazier, the first time I refer to that list variable is NOT where the error is being thrown! The error occurs on the first System.debug call on the second IF statement!
It is giving me a headache trying to figure out what could possibly be wrong! PLEASE HELP!!!!
From what I am seeing, the list variable synchedDates is initialized and not out of scope. This error occurs in both the Salesforce Developer Console as well as Oracle.
Even crazier, the first time I refer to that list variable is NOT where the error is being thrown! The error occurs on the first System.debug call on the second IF statement!
It is giving me a headache trying to figure out what could possibly be wrong! PLEASE HELP!!!!
List<SBQQ__Quote__c> synchedDates = [Select Id, PSG_Project_Synched__c, StageName__c From SBQQ__Quote__c Where QuoteID__c = :psgMasterQuoteToReset[0].PSG_Master_Quote__c ]; if (synchedDates[0].PSG_Project_Synched__c != null){ System.debug('************The Quote Synch Date Before Assigning Null Was: ' + synchedDates[0].PSG_Project_Synched__c); synchedDates[0].PSG_Project_Synched__c = null; System.debug('********Quote Synch Date is now: ' + synchedDates[0].PSG_Project_Synched__c ); } if (synchedDates[0].StageName__c != 'Bid'){ System.debug('************The Quote Stage Name Before Assigning Bid Was:' + synchedDates[0].PSG_Project_Synched__c); synchedDates[0].StageName__c = 'Bid'; System.debug('************Quote Stage Name is now: ' + synchedDates[0].StageName__c); }
Are you sure your SOQL query returns one or more records?
Try this code.
Let me know if this helps.