You need to sign in to do that
Don't have an account?
Long Duong
Can I write a VF page/component, then add it to multiple pages (Account, Opportunity,..) without changing the code
Hi
I want to write a VF page or component and user can add it to any page that he want.
I tried but found that VF page must define a specific controller or I can't add this VF page into any page(Account, Opportunity,...)
Is there a way to write a VF page/component once and use it anywhere?
Thank you so much
Hello Long Duong,
yes you can write a vf page or component that can be called from multiple vf pages, but in order to show the vf page in detail page, the page should have standard controller as api name of the object so in order to achieve this you need to write a generic vf component, that can be used for any sobject and then one page for each object where you will only call the component.
Please choose it as the Best answer, if you find it helpful .
Yes you can use vf component for multiple object. Only you need to pass id as a parameter and then you can get whatever you want to show on vf page.It is very easy process.
Thanks
Hemant
Thanks Saurabh Gupta 3039 and Hemant_Soni,
I'm using the same solution with yours.
I'm looking for a way to write once and use it anywhere without changing the code, but seem that it's impossible.
Can you please share you code and your complete requirement i will made change in your code.And please dont loose hope.
Thanks
Hemant
Hemant_Soni, I don't think code is need in this case, but it's here.
Complele requirement:
You can use below code for your component.Below code is for any object.Only you need to create page for object and pass the id of object or record and code will give you what ever you want from code.:) It is just a code sample we can use this code in apex component.
If you think this kind of code help you then i will wrote code for you.
Please let me know it helps you.
Thanks
Hemant