function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krish4ukrish4u 

Visualforce area component in Home pagelayouts

Hi  Guys,

I am disabling a button using home page component. but in recent release HTML are is deprecated and enabled visualforce area component.
thats why i have created a VF page and included some java scrip on that page and added the same in the component.

but the javascript is not working once the opportunity detail page is load. how to execute the javascript automatically from the visualforce area component.

please suggest on this.

Thanks,
Krish



 
ManojjenaManojjena
Hi Krish,

The button you want to disable is a standrad button or custom button ?
When again you are enabling that button ?
 
AshlekhAshlekh

Hi,

First think is that Salesforce is going to stop suppport to javascrip on home page component. (If I am wrong then please upate me)

If salesforce is currently supporting Java Script then you can just write a alert('test'); and verify it .

 

<script>
alert('--test---'); /* if it works then you can just write actual js code here and please find the proper id of element which you want to disable. As //some time SF make complex to identify the id of element.*/
</script>
 

 

krish4ukrish4u
Thank you friends for reply.....

@Manoj 
It is custom button based on the one field value i will disable the button.

@AKG
I have tested with alert but not working some thing needs to be done to execute the script.

Salesforce is mentioned in the component area that "If you want to use JavaScript or other advanced HTML elements in your home page component, we recommend that you create a Visualforce Area component instead."

 
ManojjenaManojjena
Hi Krish,

As per my knowledge html area in home page is depricated from last version . So it will not work  .
This is not the best practice but still it depends on you ,

Cretae two record type and two layout for each ,One layout add the button another remove .Based on the field value you need to assign the record type .
Recordtype update you can do by the help of either trigger or workflow .

Thanks 
Manoj