You need to sign in to do that
Don't have an account?
SFDCIronMan
SOQL Query for comparing Parent Cancelation_Date__C Opportunity with Child CloseDate Opportunity for Deletein
**SOQL Query for comparing Parent Opportunity Cancelation_Date__C with Child Opportunity CloseDate for Deleteing Child Opportunities where Parent Opportunity Cancelation_Date__c Is less then Child Opportunity CloseDate**
//Please Help solve this
for(Opportunity childOppty : oppsToInsert)
{
for(Opportunity parentOppty : ListOpp)
{
if(parentOppty.Cancelation_Date__c != Null && childOppty.CloseDate > parentOppty.Cancelation_Date__c ||parentOppty.Service_End_Date__c != Null && childOppty.CloseDate > parentOppty.Service_End_Date__c)
{
childOppIds.add(childOppty.Id);
parentDate = parentOppty.Cancelation_Date__c;
}
}
}
List<Opportunity> oppsToDelete = [Select Id, CloseDate, Parent_Opportunity__c From Opportunity Where Id IN : childOppIds];
if(!oppsToDelete.isEmpty())
{
delete oppsToDelete;
}
//
Thanks in Advance
//Please Help solve this
for(Opportunity childOppty : oppsToInsert)
{
for(Opportunity parentOppty : ListOpp)
{
if(parentOppty.Cancelation_Date__c != Null && childOppty.CloseDate > parentOppty.Cancelation_Date__c ||parentOppty.Service_End_Date__c != Null && childOppty.CloseDate > parentOppty.Service_End_Date__c)
{
childOppIds.add(childOppty.Id);
parentDate = parentOppty.Cancelation_Date__c;
}
}
}
List<Opportunity> oppsToDelete = [Select Id, CloseDate, Parent_Opportunity__c From Opportunity Where Id IN : childOppIds];
if(!oppsToDelete.isEmpty())
{
delete oppsToDelete;
}
//
Thanks in Advance
Abhinav (Salesforce Developers)
Not able to understand your query requirement. Could be please be more specific .