You need to sign in to do that
Don't have an account?
Sunil Kandel 10
Visualforce to show more than 10 columns in related List
Hi all,
I have two objects in Master Detail relationship.
Ticket__c is a Master and Ticket_item__c is Child.
I have related list of Ticket_item__c in Ticket__c but it is standard page and it will show only 10 columns.
I want to display the Ticket_item_c list in Ticket Page Layout with 12 columns.
Can you please point any sample visualfore page on how to write this.
Thank you
I have two objects in Master Detail relationship.
Ticket__c is a Master and Ticket_item__c is Child.
I have related list of Ticket_item__c in Ticket__c but it is standard page and it will show only 10 columns.
I want to display the Ticket_item_c list in Ticket Page Layout with 12 columns.
Can you please point any sample visualfore page on how to write this.
Thank you
When you perform a child to parent query you have to use Child Relationship Name for child object followed by __r. By default it will be your plural name. You can find this on your child object on field(Master-Detail)..How to perform soql query refer this link https://developer.salesforce.com/forums/?id=9060G000000XbH5QAK
However Make the code changes
All Answers
VisualForce Page
Apex Code
After making the page add it into the detail page of Ticket__c using PageLayout
Hi Ayush,
Thank you for your detailed code. Appreciated. I will try at my end and let you know if any errors. I will not forget to come back to mark your anser the best anwer.
Appreciated.
Getting these error while creating a class. I even tried using FX5__Ticket_item__r, but still the same error
Error: Compile Error:
FROM FX5__Ticket_Item__c ) from FX5__Ticket__c
^
ERROR at Row:3:Column:15
Didn't understand relationship 'FX5__Ticket_Item__c' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 8 column 16
Thank you
When you perform a child to parent query you have to use Child Relationship Name for child object followed by __r. By default it will be your plural name. You can find this on your child object on field(Master-Detail)..How to perform soql query refer this link https://developer.salesforce.com/forums/?id=9060G000000XbH5QAK
However Make the code changes
Thank you Ayush, It worked.
Thank you