You need to sign in to do that
Don't have an account?
Ratheven Sivarajah
How do you create a button when clicked will send you to that link
Hey So I have created a button where I want the !res.Detail_Link__c to be displayed in the button and I want it to go to the link when click on !res.Detail_Link__c and if there is no link the button should not be visible.
<apex:page controller="TechnologyProduct" lightningStylesheets="true">
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection title="Vitality Check Attributes">
<apex:repeat value="{!TechnologyProduct}" var="res">
<apex:outputText value="{!res.Detail_Link__c}" /><br/>
<apex:commandButton value="{res.Detailed_Product_Name__c}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:page controller="TechnologyProduct" lightningStylesheets="true">
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection title="Vitality Check Attributes">
<apex:repeat value="{!TechnologyProduct}" var="res">
<apex:outputText value="{!res.Detail_Link__c}" /><br/>
<apex:commandButton value="{res.Detailed_Product_Name__c}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:commandButton value="{!res.Detailed_Product_Name__c}" onclick="window.location.href='{!res.Detail_Link__c}'" rendered="{!res.Detail_Link__c != null}" />
All Answers
<apex:page controller="TechnologyProduct" lightningStylesheets="true">
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection title="Vitality Check Attributes">
<apex:repeat value="{!TechnologyProduct}" var="res">
<apex:outputText value="{!res.Detailed_Product_Name__c}" /><br/>
<apex:outputPanel rendered="{!res.Detail_Link__c != null}" layout='none'>
<apex:commandButton value="{!res.Detailed_Product_Name__c}">
<apex:outputLink value="{!res.Detail_Link__c}" />
</apex:commandButton >
</apex:outputPanel>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:commandButton value="{!res.Detailed_Product_Name__c}" onclick="window.location.href='{!res.Detail_Link__c}'" rendered="{!res.Detail_Link__c != null}" />