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
keshin okawakeshin okawa 

JSremoting with PageBlockTableEnhancer Only Displays ID as Text Instead of Lookup

Hi everyone. I used PageBlockTableEnhancer to show my records from an object. The problem is I can't list more than 1k records due to limits so I searched and found that you can with JSremoting from here @http://blogforce9.blogspot.com/2014/10/showing-more-than-1k-records-using-pbe.html . I was able to display 1.4k records successfully but I noticed that lookup data is only shown as ID and is just considered text. Is there a workaround for it to behave the same as without using JSremoting? The lookup data shows fine with just PageBlockTableEnhancer.
 


User-added image

 
Terence_ChiuTerence_Chiu
Keshin, have you tried pulling the name field of the lookup record from the soql query via a relationship query.  For instance if the related object in your example was called Platform__c the query could look like the following

SELECT Id, Name, Platform__c, Platform__r.Name FROM Object__c

Platform__c would return the 18 character Id and Platform__r.Name would return the name of the actual related lookup record.

 
keshin okawakeshin okawa
@Terence_Chiu..I already tried it but I get this message

Uncaught Type Error: Cannot read property "Name" of null

anyone have suggestions/ideas?
Terence_ChiuTerence_Chiu
I encountered similiar issues where relationship queries did not work with visualforce remote objects. A workaround I did was to create a text formula field that would pull the field value from the related record. So instead of querying for the related object field I queried for the custom formula field that will have the Name of related record.