You need to sign in to do that
Don't have an account?
Prabhat Arora
Testing overriding functionality with visualforce extensions
Hi All,
Needed a help in testing the VF Extension, I am overiding the OLI "EDIT" button to redirect to some custom VF page, below is my controller extension & VF page used for redirecting,
Below is the extension Controller.
Help will be Highly appreciated.
Needed a help in testing the VF Extension, I am overiding the OLI "EDIT" button to redirect to some custom VF page, below is my controller extension & VF page used for redirecting,
<apex:page standardController="OpportunityLineItem" extensions="redirect_Ext" action="{!if(rCardUploaded==TRUE,'/apex/IRC_VF?oppId='+OpptyId,URLFOR($Action.OpportunityLineItem.Edit,OpportunityLineItem.Id,[ saveURL=OpportunityLineItem.Id,retURL=OpptyId],true))}"> </apex:page>This VF Page is redirecting to another VF Page (IRC_VF) on meeting a check box true condition.
Below is the extension Controller.
public class redirect_Ext { public OpportunityLineItem opptyLineItemRec; Public Opportunity OpptyRec; Public String OpptyId{get;set;} public Boolean rCardUploaded{get;set;} public redirect_Ext(ApexPages.StandardController controller) { opptyLineItemRec = [select id, Imported_from_Rate_Card_c__c, OpportunityId from OpportunityLineItem where id =: System.currentPageReference().getParameters().get('id')]; rCardUploaded = opptyLineItemRec.Import_from_R_Card_c__c; OpptyId = opptyLineItemRec.OpportunityId; } }Everything is Working perfect, I NEED HELP on Writing Test Class, as i am not able pass the pagerefernce or redirecting amongst the pages, i had created the test data, only need an understanding on how to cover testing page navigation in this scenario.
Help will be Highly appreciated.
FYI, in your apex class, you have Imported_from_Rate_Card_c__c and Import_from_R_Card_c__c.
Is that correct? I was not sure which one to use in the test class, I went with Imported_from_Rate_Card_c__c.
All Answers
FYI, in your apex class, you have Imported_from_Rate_Card_c__c and Import_from_R_Card_c__c.
Is that correct? I was not sure which one to use in the test class, I went with Imported_from_Rate_Card_c__c.
thank you so much.