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

Apex Trigger Date Range
Hi,
I am using one trigger which will calculate a date range from my Policy object to Opportunity Object.
I am having a field named Proposal Date in Opportunity and Maturity date in policy object.
So I want to put a logic like if proposal date is 12/3/2019 so the Maturity date should be 19/3/2019 to 30/3/2019.If this range will true then it will okay otherwise it will through a error.
I have written something like
if(io1.Proposal_Date__c<po.Maturity_Date__c-7)
but this is not working.Please help.
I am using one trigger which will calculate a date range from my Policy object to Opportunity Object.
I am having a field named Proposal Date in Opportunity and Maturity date in policy object.
So I want to put a logic like if proposal date is 12/3/2019 so the Maturity date should be 19/3/2019 to 30/3/2019.If this range will true then it will okay otherwise it will through a error.
I have written something like
if(io1.Proposal_Date__c<po.Maturity_Date__c-7)
but this is not working.Please help.
Try with below code.
Usually to test between two date range you will use below syntax.
Best Regards,
Sandhya