You need to sign in to do that
Don't have an account?
Enara Marcos
Hide a button from home page component
We have an opportunity line custom button in the opportunity line related list of the opportunity page layout. This button must be showed only when the country of the oportunity is one of a list (list indicated in a custom setting). This dependency is not corresponds to profiles (because some profiles can manage more than one country).
Our solution is the create an html home page component to put it as a narrow component. We can hide the button thanks to jquery, but we need to do 2 queries to known if the button should be hidden or not. We can't achieve it.
So, we decided to do the same with visualfoce home page component as a narrow componet, however, it is not possible to hide the button (we can't get elements outside the visualforce) or we don't know how to do it.
Is there any solution for this goal?
Our solution is the create an html home page component to put it as a narrow component. We can hide the button thanks to jquery, but we need to do 2 queries to known if the button should be hidden or not. We can't achieve it.
So, we decided to do the same with visualfoce home page component as a narrow componet, however, it is not possible to hide the button (we can't get elements outside the visualforce) or we don't know how to do it.
Is there any solution for this goal?
I need to hide a button X inside the opportunity product related list of opportunity page layout. The condition to hide it, is wether the country of the opportunity is not in a custom setting.
Solution:
- create new opportunity product button Y: onclick javascript
- create an html home page component Z as a narrow component and add it to all home page layouts
* html home page component Z must click the button Y.
* button Y must hide itselft and calls to the custom setting. If the opportunity country not corresponts to a value of the custom setting record, then button Z must hide button X.
All Answers
http://bobbuzzard.blogspot.co.uk/2014/06/javascript-in-salesforce-home-page.html
I need to hide a button X inside the opportunity product related list of opportunity page layout. The condition to hide it, is wether the country of the opportunity is not in a custom setting.
Solution:
- create new opportunity product button Y: onclick javascript
- create an html home page component Z as a narrow component and add it to all home page layouts
* html home page component Z must click the button Y.
* button Y must hide itselft and calls to the custom setting. If the opportunity country not corresponts to a value of the custom setting record, then button Z must hide button X.