You need to sign in to do that
Don't have an account?
Err When creating opportunity - Required fields are missing: [CloseDate]
Hi...
I have an Issue in a Test case....
While inserting the Opportunity....I used the ClosedDate Field...But am getting Error as
System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [CloseDate]: [CloseDate]
Test Case that i Have Used is :
@isTest
private class NewDisbursementMemo_TC
{
static testMethod void test()
{
Branch__c b = new Branch__c();
b.name = 'qwe';
insert b;
Account a = new account();
a.name='asd';
insert a;
Opportunity o=new Opportunity ();
o.Name='qwer';
o.CloseDate=date.ValueOf('2011-09-21');
o.StageName='Prospecting';
o.Branch__c=b.id;
o.AccountId = a.id;
insert o; // Getting Error at this line
Disbursement__c d= new Disbursement__c();
d.Loan__c=o.id;
insert d;
ApexPages.currentPage().getParameters().put('id', d.id);
ApexPages.StandardController con = new ApexPages.StandardController(d);
NewDisbursementMemo ext = new NewDisbursementMemo(con);
}
}
Thanks in Advance
o.CloseDate=system.today();
Thanks for your reply...
I Used o.CloseDate=system.today();
But Still am Getting the same error.. as System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [CloseDate]: [CloseDate]
is there any opportunity triggers that may fire in the insert call of the opportunity ...