You need to sign in to do that
Don't have an account?
venkatsforce
show a standardview page using custom button
i want to show the standardview from visualforcepage using custom button.....any examples....
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
i want to show the standardview from visualforcepage using custom button.....any examples....
<apex:commandButton id="aid" action="{!URLFOR($Action.Account.view, acc.id)}" value="Details"></apex:commandButton>
All Answers
http://yourinstenceName/recordId
like
https://cs10.salesforce.com/a02J0000001b27i
Ths s my code
<apex:page controller="showAccountdetails">
<apex:form >
<apex:pageBlock >
<apex:pageblockTable value="{!account}" var="acc">
<apex:column value="{!acc.Name}"/>
<apex:column value="{!acc.Phone}"/>
<apex:column value="{!acc.Industry}"/>
<apex:column headerValue="Action">
<apex:commandButton value="Details" action="{!showDetails}">
<apex:param name="accId" value="" assignTo="{!accId}"/>
</apex:commandButton>
</apex:column>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
public class showAccountdetails
{
public PageReference showDetails()
{
String recordId= apexpages.currentpage().getParameters().get('accId');
// for(Account ac:[Select Id,Name from Account where Id=:id])
PageReference pg = new PageReference('https://ap1.salesforce.com/001/Account/RecordId');
// PageReference pg= new PageReference('ap1.salesforce.com/=+{Id}'&retURL=%2F'+recordId );
return pg;
}
public String accId { get; set; }
public List<Account> account { get; set; }
public showAccountdetails()
{
LoadAcc();
}
public void LoadAcc()
{
account = [Select Name,Phone,Industry from Account];
}
}
if it is execute means it shows one details button in each column and if i click means its move on to standardpage......
Any Changes in this code ,Help.......
Try these changes.
Hit the Kudos button if any post helps you - Mark the answer as solution, It might help others running to into similar problem in future.
In AddressBar its shows like this at the time of click the detail button
https://ap1.salesforce.com/null
Do this change with showDetails method
Shankar,
Its also showing null in addressbar https://ap1.salesforce.com/null
Then there is a issue with the parameter. Isuue is in following line
Check your page parameter called "accId"
Hit the Kudos button if any post helps you - Mark the answer as solution, It might help others running to into similar problem in future.
Hi chamil,
Is there any mistake in my VFpage
<apex:page controller="showAccountdetails">
<apex:form >
<apex:pageBlock >
<apex:pageblockTable value="{!account}" var="acc">
<apex:column value="{!acc.Name}"/>
<apex:column value="{!acc.Phone}"/>
<apex:column value="{!acc.Industry}"/>
<apex:column headerValue="Action">
<apex:commandButton value="Details" action="{!showDetails}">
<apex:param name="accId" value="" assignTo="{!accId}"/>
</apex:commandButton>
</apex:column>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Try following code with your visualforce page
It doesn't look like you're setting the accId value. Try:
Can you post URL, when you are on your custom visual force page. I mean page which calls the controller method - (showDetails) with command button, on that time what is your URL.
Url is https://ap1.salesforce.com/null on the time of calling Showdetails method......
<apex:commandButton id="aid" action="{!URLFOR($Action.Account.view, acc.id)}" value="Details"></apex:commandButton>