You need to sign in to do that
Don't have an account?
Larry Caper II 7
Display Related List from Custom Object on Case Layout
I would like to display a related list from a custom object on my Case record. Please reference the information below:
I hear a visualforce page will do the job. However, I'm unsure where to start, what APEX code to use and how to bring it all together.
Thanks in advance for anyone willing to help me out!
- Case Object: Contains a lookup field (Listing__c)
- Listing Object: Master in a master-detail relationship with an object called Booking Rule(BookingRule__c)
- Booking Rule Record: Due to the master-detial relationship, every Booking Rule record is associated to a Listing
I hear a visualforce page will do the job. However, I'm unsure where to start, what APEX code to use and how to bring it all together.
Thanks in advance for anyone willing to help me out!
Your scenario can be achieved by creating an inline visualforce page. Since this inline page will be create for Case page layout the VF page will use Case standard controller and an custom extension to support your requirement.
Please see below few articles that can guide you through the process.
The Listing lookup field lives on the Case Record. I want to show all Booking Rules related to that Listing record as a section on the Case page layout. Basically, there will be a section, on the Case page layout, of all Booking Rules related to the Listing within the Case. I'm not sure where to start to get the mapping correct or build a controller or VF page.
Since i am not aware of the structure field api names of your org its hard to provide the exact code. However i have tried to create an skeleton code that should help you in building up the rest. Please see below the skeleton code. Items in BOLD needs your org specific inputs.
Once you have created the below extension and vf page, go to your Case layout and add this vf page.
Create an extension class
Create a vf page "BookingRuleRelatedList"
Those <b> </b> tags were added automatically by the forum when i tried to apply BOLD to them. Please remove them from your code.
I removed them from the code. However, I receive the following error after trying to save: "
Error: Compile Error: Identifier name is reserved: case at line 3 column 18". I
I received the following error: "Error: Compile Error: unexpected token: ';' at line 4 column 18"
I dont have the schema in my org to try out the code, the code is just skeleton so that you can update it based on your org structure. Like the error suggested the constructor name was invalid. Now constructor name should be same as class name therefore chanding the constructor name to match class name should fix the issue