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

Help with visualforce pages



I want to create a non editable visualforce page named asset history.In that page i want a look up field form which when we search the particular asset it should show the fields like Name,Status,Contact.Name.


Also i want to show the field caseNumber in that  page from the case object.

The relationship between case and asset is that there is an asset lookup in the case object.


can someone please help me.






See this Data Model for case :-


Asset is not available in case by default, but it is there in the standard field of Case. You need to add this field in Page Layout..


Eg,SELECT AccountId,AssetId FROM Case limit 5


Hope this helps..


Please mark this answer as solved if it helped you..








I have written the code below and i am getting the fields of asset name,status and contact after i enter the asset name in the search text.


I also want the caseNumber from cases when i search a particular asset as i have created an asset lookup in the case object. How can i do it can u help me.


and also i am entering the asset name in the search text box how can i make it a look up so that i can select from the look up.


Controller class:


public class theController {
String searchText;
List<Asset> results;

public String getSearchText() {
return searchText;
public void setSearchText(String s) {
searchText = s;
public List<Asset> getResults() {
return results;
public PageReference doSearch() {
results = (List<Asset>)[FIND :searchText RETURNING Asset(Name,Status,Contact.Name)][0];

return null;



VF Page:

<apex:page controller="theController" >
<apex:form >
<apex:pageBlock mode="edit" id="block">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel for="searchText">Search Text</apex:outputLabel>
<apex:panelGroup >
<apex:inputText id="searchText" value="{!searchText}"/>

<apex:commandButton value="Go!" action="{!doSearch}" rerender="block" status="status"/>
<apex:actionStatus id="status" startText="requesting..."/>
<apex:pageBlockSection title="Results" id="results" columns="1">
<apex:pageBlockTable value="{!results}" var="l" rendered="{!NOT(ISNULL(results))}">
<apex:column value="{!}" />
<apex:column value="{!l.status}"/>
<apex:column value="{!}" />



Please help me.