• jpushpan
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

Does any one know a way of finding the fieldid of an object programatically?

 

Ex: I have an Account object and I want to find the fieldid of Account.ParentID. 

 

cheers,

Jackson

I am new to visualforce development and I have a question regarding lookup fields.

 

I have a visualforce page in which I am displaying data using jqgrid. The controller returns json data, which is consumed by the jqgrid. This works fine.

When I select and edit a row,  jqgrid generates a form dyanmically with HTML input field based on the column definition given  and prepopulates the data for that row  under each field.

Now my problem is , one of the field in the form is a look up field  and I want to show the lookupfield icon next to the field. in otherwords, I want to mimic the behaviour of lookup field on a html input field.

 

Does any one have suggestions on how this can be done?

 

Help much appreciated.

jackson

I have a visualforce page and I am using jqgrid to display data on this page. The url that the jqgrid points to is a visualforce page(https://test.visual.force.com/apex/GridResults) which outputs only JSON data. This page does not have any header or html information.

The problem is that when I run the page with grid, the grid renders with column names but no shows no data.

The page which outputs JSON data is working correclty.  I have pasted below the code.

   jQuery("#list").jqGrid({
        url
:"https://test.visual.force.com/apex/GridResults",
        datatype
: "json",
        colNames
: [{!fieldNames}], -- property in controller  which outputs fieldnames
        colModel
: [{!colModel}], -- property in controller which outputs column definition
        rowNum
: 10,
        rowTotal
:10,
        rowList
: [20, 40, 60],
        loadonce
:true,
        mtype
:"GET",
        gridView
:true,
        pager
: '#pager',
        sortname
: 'Record ID',
        sortorder
: "desc",
        width
: 1200,
        height
: 400,
        caption
: "Accounts"
   
});  
    jQuery
("#list").jqGrid('navGrid', "#pager", { edit: true, add: true, del: false })
   
};

Any ideas on how the JSON data from the page can be consumed by the jqgrid? Help much appreciated.

Does any one know a way of finding the fieldid of an object programatically?

 

Ex: I have an Account object and I want to find the fieldid of Account.ParentID. 

 

cheers,

Jackson