You need to sign in to do that
Don't have an account?
Ramesh Varatharaj
Help with test class
i need help on test class for the below class (i took it from the internet and modified to fit my requirement). I am not from development backgroup, so yours help is much appreciated.
public class RSInsert{
Apexpages.StandardController controller;
public RSInsert(Apexpages.StandardController c){
controller = c;
}
public PageReference save() {
controller.save();
PageReference onn = new PageReference('https://cs30.salesforce.com/apex/FTESampleEdit?id='+controller.getId());
Onn.setRedirect(true);
return onn; //return Apexpages.currentPage();
}
}
Hi,
I assume standardcontroller of your page is account and you can use below code snippet:-
Anyway, you can modify it to solve your problem.
Let me know if you have any issue with it.
Happy to help you!
I have added lines to insert account, opportunity and the related pirce book entry.
Hi,
Please try below code snippet. I assumet only mandatory field on Price_Book__c is Name field:-
Please let me know if you still see any issue.
Happy to help you!
Prasad, i got it to work. Thanks for your help.