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

Help on Testing (Trigger, too many DML rows 10001)
Another board member helped me develop this trigger - but I need a little advice on where to head for testing this trigger. I Read through http://teachmesalesforce.wordpress.com/2011/05/07/how-to-write-a-trigger-test/ but had some hard time understanding...
From what I can understand, I'd have to create a contact, an order, and then try to populate the fields and do testing? Can anyone provide some guidance?
Edit - cleaned up my trigger a bit.
trigger lastEngagedDate on Order__c (after insert, after update) { set<id>must=new set<id>(); for(Order__c o : Trigger.new) { must.add(o.Vendor_Name__c); } Order__c o = [SELECT Valuation_Contracted_Date__c, Status__c, Vendor_Name__c FROM Order__c WHERE Vendor_Name__c IN:must ORDER BY Valuation_Contracted_Date__c DESC LIMIT 1]; List<Contact> vendor = new List<Contact>(); if(o.Status__c=='Valuation Contracted' && o.Valuation_Contracted_Date__c!=null) { vendor.add(new Contact(Id = o.Vendor_name__c, Last_Engaged_Date__c = o.Valuation_Contracted_Date__c)); update vendor; } }
This Salesforce article may be clearer and simpler to start with:
http://wiki.developerforce.com/page/How_to_Write_Good_Unit_Tests
Start with Order
Enter all tha mandatory fields and if you have a lookup field on order write the test details for that look up object and reference it in order.
Keeping doing it backforth
last implement the test values in the way you want in the logic while updating or inserting
Thanks for the help all - I have a question on how to insert a two lists (volume inserts) and then associate the list records of one list to the other (1:1 for the Ids).
Proposals has a lookup to Orders, and each Order needs a unique, "Accepted" proposal. This is what I have so far.
This gives me a Too many DML Rows:10001 error? It happens on when i insert rfpList;