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

CommandLink opening wrong page
Hello everyone!
I am using apex:commandLink for a VF list page but it is opening the wrong edit page. The edit button is currently opening the edit opportunity product details and I need it to open the Product Line Item schedules instead (this page: /related/OpportunityLineItemSchedules/view). I have tried using different actions, a custom URL, and a ton of other options but I can't get anything to work. Does anyone have an answer?
Thanks!
VF page with the button:

Current Code:
I am using apex:commandLink for a VF list page but it is opening the wrong edit page. The edit button is currently opening the edit opportunity product details and I need it to open the Product Line Item schedules instead (this page: /related/OpportunityLineItemSchedules/view). I have tried using different actions, a custom URL, and a ton of other options but I can't get anything to work. Does anyone have an answer?
Thanks!
VF page with the button:
Current Code:
<apex:page standardController="Opportunity" action="{!getOLIS}" tabStyle="Opportunity" extensions="OpportunityScheduleExtension" lightningStylesheets="true"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!lstOLIS}" var="lst" > <apex:column headerValue="Product" value="{!lst.OpportunityLineItem.Product2Id}"/> <apex:column headerValue="Date" value="{!lst.ScheduleDate}"/> <apex:column headerValue="Revenue" value="{!lst.Revenue}"/> <apex:column ><apex:commandLink action="{!edit}" value="Edit" id="EstablishOpportunityLineItemSchedules"/></apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
public with sharing class OpportunityScheduleExtension { Opportunity objOpp; public list<OpportunityLineItemSchedule> lstOLIS {get;set;} public OpportunityScheduleExtension(ApexPages.StandardController controller) { this.objOpp= (Opportunity)controller.getRecord(); } public void getOLIS(){ lstOLIS = new list<OpportunityLineItemSchedule >(); system.debug('objOpp---------->'+objOpp); for(OpportunityLineItemSchedule objOLIS:[Select Id, ScheduleDate, Revenue, OpportunityLineItem.Product2.Name, Description,Product_Name2__c, NAME__c from OpportunityLineItemSchedule where OpportunityLineItem.OpportunityId =:objOpp.Id] ){ lstOLIS.add(objOLIS); } } }
<apex:column headerValue="Edit"> <apex:outputLink value="/{!lst.id}/e">Edit</apex:outputLink> </apex:column>
All Answers
Please try this:
Thanks for the response! Unfortunately, now the edit button is gone from the page entirely.
<apex:column headerValue="Edit"> <apex:outputLink value="/{!lst.id}/e">Edit</apex:outputLink> </apex:column>