You need to sign in to do that
Don't have an account?
sgorema
Scontrol to create a filtered list of opptys for an account?
Am I correct in thinking that I could build an scontrol with the Ajax toolkit that would allow me to display a subset of an Accounts opportunities and have it look like just another related list on the Account detail page? We would like to show a seperate list of just 'Open' opptys on the Account detail page. Can anyone point me in the direction of sample code that does something similar to this? thanks!
You can't replicate related lists using s-contols exactly - you can place an s-control that looks similar in a new section on the main area of the Accounts Page.
To get a sense of what it would look like, use Ajax Tools (check appexchange if you don't have it) which create the basic code to get the data and display it in basic HTML.
Create a new s-control, paste the code into it, create a new section on the Account Page, and you can then select the s-control from the available objects on the right (where the available fields are - just select s-controls from the drop down) and drag it into the new section.
If you think that it works ok functionally, you can then add css style sheets and HTML tags to make the section look pretty similar to an related list.
But once you get the idea of how the data is retrieve and displayed, putting it into a table and applying style formats is just using HTML.
Code:
Try this, and replace the accountcr fields with your oppty.[fieldname]
Code:
thanks..this looks much better. the only issue i am now having is the hyperlink links to the opportunity but it does not use the whole browser to go there. it navigates to it just from the layout section.
I also found this code which replicates the look and feel of the related list. Just have no idea how I would add the code to populate it with records!
http://wiki.apexdevnet.com/index.php/Salesforce_Look_and_Feel.html
Re the example, it should just be a question of wrapping their code around your HTML, since it is really a wrapper to the HTML table...