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
Ratheven SivarajahRatheven Sivarajah 

how do you remove istdp p1 at the end of URL

I have created a VF page which has a command link that take me to my desired link but there is istdp p1 at the end of the URL which I dont want. Thank you in advance.

<apex:page controller="TechnologyProduct"  lightningStylesheets="true" showHeader="false" sidebar="false" applyBodyTag="false" applyHtmlTag="false">
<style type="text/css">
    [id*=button] {  
                    border: 1px solid black !important;
                    color: black !important;
                    text-decoration: none !important;
                    padding: 9px !important;
                    cursor: pointer !important;
 }
 [id*=wrapper] {    
                    margin: auto;
                    width: 50%;
                    text-align: center !important;
                    padding: 10px;
                    height: 100px !important;
                }
  [id*=repeat] {    
                    margin: 20px !important; }
   
</style>
    <div id="wrapper">
     <apex:repeat value="{!TechnologyProduct}" var="res" id="repeat">
            <apex:outputPanel rendered="{!res.Detail_Link__c != null}" layout='none'>
                    <apex:outputlink value="{!res.Detail_Link__c}" styleClass="btn" id="button"> {!res.Detailed_Product_Name__c} </apex:outputlink>                  
            </apex:outputPanel>
     </apex:repeat>
    </div>
</apex:page>
Shri RajShri Raj
To remove the "istdp p1" from the end of the URL, you can modify the Detail_Link__c field value in the TechnologyProduct object, or you can modify the value of the link in the VF page.
In the VF page, you can modify the value of the outputlink as follows:
<apex:outputlink value="{!res.Detail_Link__c.replace('istdp p1','')}" styleClass="btn" id="button"> {!res.Detailed_Product_Name__c} </apex:outputlink>
This should remove the "istdp p1" from the end of the URL and give you the desired link.
sarika shirkesarika shirke
To remove "istdp p1" from the end of the URL, you can modify the value of the output link to exclude the unwanted string.

Replace this line:
<apex:outputlink value="{!res.Detail_Link__c}" styleClass="btn" id="button"> {!res.Detailed_Product_Name__c} </apex:outputlink>

With this line:
<apex:outputlink value="{!LEFT(res.Detail_Link__c, FIND('istdp p1', res.Detail_Link__c) - 1)}" styleClass="btn" id="button"> {!res.Detailed_Product_Name__c} </apex:outputlink>

This uses the LEFT and FIND functions to extract the portion of the URL before the "istdp p1" string and uses that as the value for the output link. https://www.rebaid.org/
Prateek Prasoon 25Prateek Prasoon 25
how do you remove istdp p1 at the end of URL ?

VF Page
<apex:page controller="devForamQue" action="{!devForamQue}">
   <p>
       Google link ::  {!urlLink}
    </p>
    <apex:outputlink value="{!LEFT(urlLink, FIND('istdp p1', urlLink) - 1)}" styleClass="btn" id="button"> Google </apex:outputlink>
</apex:page>

APEX CLass
public class devForamQue {
    public string urlLink{get;set;}
    public void devForamQue(){
        urlLink = 'https://www.google.com/maps/istdp p1';
        system.debug('urlLink :: '+urlLink);
    }


If you find my answer helpful please mark it as the best answer.
Ratheven SivarajahRatheven Sivarajah
@Prateek Prasoon 25 Thank you for your help. I wrote my code to how your code was written and The links are there but when I click it nothing happens.