+ Start a Discussion
MeerMeer 

VisualForce page help needed

Hi,

 

I have a custom object named as 'Journal', it has several feilds, I want to create a visual force page in which i want to show all the details of the Selected Journal same as it is shown in detail page.. How can i achive this?

 

Following is the code for VisualForce page

 

<apex:page controller="Fin_JournalManager" id="JournalPage" tabStyle="Fin_Journal__c" >
<apex:pageBlock title="Journal Information">
<b>Journal {!Journal}.</b>
</apex:pageBlock>
<apex:detail />
</apex:page>

 

Regards,

Meer

Best Answer chosen by Admin (Salesforce Developers) 
Devendra@SFDCDevendra@SFDC

 

Hi,

 

Create a visual force as i have mentioned earlier.

 

Use standard controller.

 

Now go to Setup-->Create-->Object-->Standard Buttons and Links

 

Click on View and Edit-->Select Visual Force that you have created.

 

When you click on Journal record, you will navigate to custom detail page that you have created.

 

Hope this helps:)

 

Thanks,

Devendra

All Answers

Devendra@SFDCDevendra@SFDC

Hi Meer,

 

Try this,

 

<apex:page standardController="Journal__c">
<apex:form>
<apex:pageBlock title="My Content" mode="edit">
<apex:pageBlockButtons>
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="My Content Section" columns="2">
<apex:inputField value="{!Journal__c.name}"/>
<!-- Add more fields here-->
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

Note: Remember, for this page to display Journal data, the ID of a valid account record must be specified as a query
parameter in the URL for the page. For example,

https://Salesforce_instance/apex/myPage?id=SpecifyJournalRecordId

 

Hope this helps:)

 

Thanks,

Devendra

MeerMeer

I have the following control class

 

public class Fin_JournalManager
{
List<Fin_Journal__c> journal;

public List<Fin_Journal__c> getJournal()
{
if(journal== null)
{

journal = [SELECT Fin_Journal__c.Name,Batch__c,Card__c, Category__c,Create_Date__c,JrnlTotCr__c , Currency__c, JrnlTotDr__c FROM Fin_Journal__c where Fin_Journal__c.Name = 'JV-0019'];

}
return journal;
}

public PageReference save()
{
update journal;
return null;
}

}

Devendra@SFDCDevendra@SFDC

Hi Meer,

 

Can you please tell us your requirement?

 

Thanks,

Devendra

hisrinuhisrinu
<apex:page standardcontroller="Journal__c">
<apex:detail />
</apex:page>


or else

<apex:page controller="Fin_JournalManager" id="JournalPage" tabStyle="Fin_Journal__c" >
<apex:detail subject="Pass the journal record id"/>
</apex:page>

 

MeerMeer

Hi,

 

Actually I am looking to create my own Detail Page similar to default Detai Page, in it I'll be lately try to make some emedments. After clicking the record shown on Home page of the Journal I want to redirect the window to the custom Detailed Page, but yet I don't have any custom Detail Page.. thus, at first I am trying to develop my own detail page.

 

Hope everything is clear now.

 

Regards,

Meer

Devendra@SFDCDevendra@SFDC

 

Hi,

 

Create a visual force as i have mentioned earlier.

 

Use standard controller.

 

Now go to Setup-->Create-->Object-->Standard Buttons and Links

 

Click on View and Edit-->Select Visual Force that you have created.

 

When you click on Journal record, you will navigate to custom detail page that you have created.

 

Hope this helps:)

 

Thanks,

Devendra

This was selected as the best answer
MeerMeer

Thanks dear, you are right

 

Regards,

 

Meer