Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Apex Code Development
- :
- Err When creating opportunity - Required fields ar...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Err When creating opportunit y - Required fields are missing: [CloseDate ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-05-2013 12:36 AM
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
Re: Err When creating opportunit y - Required fields are missing: [CloseDate ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-05-2013 12:51 AM
o.CloseDate=system.today();
My Blog
Kiran
Re: Err When creating opportunit y - Required fields are missing: [CloseDate ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-05-2013 12:56 AM
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]
Re: Err When creating opportunit y - Required fields are missing: [CloseDate ]
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-05-2013 01:25 AM - edited 02-05-2013 01:26 AM
is there any opportunity triggers that may fire in the insert call of the opportunity ...
My Blog
Kiran

