function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rocio VivancoRocio Vivanco 

Edit action on customized related list leads to Edit Page Layout within a Visualforce embedded in a Section

Hi all,

many speak of custom related lists with the possibility to edit or delete records on them.
I have built a visualforce component to show a custom related list with filter. This Visualforce component is within a tab panel:

User-added image


The problem is: If I click for example on the Edit Action, this leads you to the record but within the Visualforce embedded in the section "Trayectoria":

User-added image

This is an undesirable effect I would like to avoid or amend. If I click on the Edit Action I would like this to lead me to the Edit mode of the object on the tab of this object/entity, so here:

User-added image

My Visualforce page is this:
 
<apex:component access="global" controller="SIs_Test">

  <apex:attribute name="accountIdValue" type="String" description="This is the Id of the account" assignTo="{!accountId}" access="global" />

    <apex:form >
       <apex:pageblock id="CustomList" title="Solicitudes de Información">
          <apex:pageblocktable value="{!solinfos}" var="solinfo" rendered="{!NOT(ISNULL(solinfos))}">
              <apex:column >
                  <apex:facet name="header">Action</apex:facet>
                  <apex:commandLink action="{!editSolInfo}" value="Edit">
                  <apex:param name="solinfoid" value="{!solinfo.id}"/>
                  </apex:commandLink> &nbsp; | &nbsp;   <apex:commandLink action="{!deleteSolInfo}" value="Delete">
                  <apex:param name="solinfoid" value="{!solinfo.id}"/>
                  </apex:commandLink>
              </apex:column>
              <apex:column headerValue="Código de SI"> <apex:outputLink value="/{!solinfo.id}">{!solinfo.name}</apex:outputLink> </apex:column>
              <apex:column value="{!solinfo.Nombre_de_candidato__r.Name}"/>  
          </apex:pageblocktable>
       </apex:pageblock>
    </apex:form>

 </apex:component>
And this part of my the Apex class:
 
global List<Solicitud_de_contacto__c> getSolInfos()
    {
   
     solinfos = [Select id, Name, Nombre_de_candidato__r.Name from Solicitud_de_contacto__c where Nombre_de_candidato__r.id =: accountId];
     return solinfos;
    }
    
    public Pagereference editSolInfo()
    {
       String solinfoid= ApexPages.currentPage().getParameters().get('solinfoid'); 
     
       return new PageReference('/a0B/e?id='+solinfoid+'&retURL=/a0B/');
    }
    
    public Pagereference deleteSolInfo()
    {
       String solinfoid= ApexPages.currentPage().getParameters().get('solinfoid'); 
     
       Solicitud_de_contacto__c solinfo = [Select id from Solicitud_de_contacto__c where id =:solinfoid limit 1];
       if(solinfo !=null && solinfo.id !=null){
         delete solinfo;
       }
       return null;
    }
How can I amend my apex code, so the Edit action leads to desired and normal place where an Edit action on a related list without customization normally leads?.
I would appreciate any tips.