You need to sign in to do that
Don't have an account?
amateur1
test case help
this is my trigger plz help with the test case
trigger Assert_Update on Opportunity (after update) { if(trigger.isupdate) { for(Opportunity o1:trigger.new) { opportunity o=[select id,Accountid,Name,Manager__r.name,Sales_Consultan__r.name, Process_Consultant_User__r.name,Process_Consultant_Manager__r.name, Branch__c,Payment_Option__c,Sales_Date__c,Process_Stage__c from opportunity where id=:o1.id]; asset a= [select id,name,Accountid,Sales_Consultant__c,Sales_Consultant_Manager__c,Process_Consultant__c, Process_Consultant_Manager__c,Branch__c,Payment_Option__c,Expected_Sale_Date__c,Process_Stage__c,opportunity__c from asset where opportunity__c=:o1.id]; a.name=o.name; a.Accountid=o.Accountid; a.Sales_Consultant__c=o.Sales_Consultan__r.name; a.Sales_Consultant_Manager__c=o.Manager__r.name; a.Process_Consultant__c=o.Process_Consultant_User__r.name; a.Process_Consultant_Manager__c=o.Process_Consultant_Manager__r.name; a.Branch__c=o.Branch__c; a.Payment_Option__c=o.Payment_Option__c; a.Expected_Sale_Date__c=o.Sales_Date__c; a.Process_Stage__c=o.Process_Stage__c; a.opportunity__c=o.id; update a; } } }
Hi create oppertunity ,asset call the trigger
this is the test case i have writte but i am getting this error plz resolve
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Assert_Update: execution of AfterUpdate caused by: System.QueryException: List has no rows for assignment to SObject Trigger.Assert_Update: line 13, column 1: []
Hi
create some new records in UI so that it will fetch those records in test classes.
Let me know any issue and if it solves ur problem plz accept it solution.
i dint get u plz can u give me code
Hi
U just create some opputunities and assets records as according in trigger so that it will get some records to fetch in test class.
Let me know any issue and if it solves ur problem plz accept it solution.
I think the problem is in your trigger code: