You need to sign in to do that
Don't have an account?
Derek Davis 7
New to APEX.... Class Working but Example/Explaination of Test Class Needed
Hi All - I am very familiar with Salesforce but newer to APEX. I recently created an APEX Class to change the behavior of a Flow Finish Button. When the finish button is clicked this class sets the URL and sets the referenced variables within the URL.
The class is working, but I'm not sure about how to go about creating the test coverage for the Class shown below. Any assistance would be appreciated!!
VF Page -
Here is the Class -
The class is working, but I'm not sure about how to go about creating the test coverage for the Class shown below. Any assistance would be appreciated!!
VF Page -
<apex:page Controller="OpptyFlowController" TabStyle="Opportunity"> <br/> <flow:interview name="CreateOppty" interview="{!myflow}" finishlocation="{!OID}" /> </apex:page>
Here is the Class -
public class OpptyFlowController { public Flow.Interview.CreateOppty myFlow { get; set; } public String getmyID() { if (myFlow==null) return ''; else return myFlow.OpptyID; } public PageReference getOID(){ PageReference p = new PageReference('/apex/opportunityProductEntry?id=' + getmyID() + '&addTo=' + getmyID() + '&retURL=%2F006%2Fe&sfdc.override=1'); p.setRedirect(true); return p; } }
If you don't get 100%, you will need to tweak it to get more coverage.
Thx As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks