You need to sign in to do that
Don't have an account?
Desai
Show/Hide a custom button based on the status field value.
Hi ,
I am new to SFDC and i need to know to show or hide a custom button based on the status field value.
I have created a custom button "Test" on custom object "Offer". When staus is New, the test button should be hidden . How can this be acheived.
Regards,
Pallavi
I am new to SFDC and i need to know to show or hide a custom button based on the status field value.
I have created a custom button "Test" on custom object "Offer". When staus is New, the test button should be hidden . How can this be acheived.
Regards,
Pallavi
Your button is on Visusalforce Page or Detail page Button.
You need to create the Custom button as Detail Page Button with Execute JavaScript behavior, and in the onClick section add the logic to change the status to New. Below is the code segment;
As I know, there is no way to inactive or grayed out the custom buttons in page layouts. Hence, you need to create two page layouts here,
Page layout 1 – for New and Modified statuses à You can insert your custom button in this page layout
Page layout 2 – for Submitted and Synced status à you are not going to add your custom in this page layout
Then create two Record Types for respective Page Layouts as you need to switch between page layouts.
Record Type 1 à for Page Layout 1
Record Type 2 à for Page Layout 2
Finally, create a workflow rule to change the Record Type. Because to click the button you should be in Page Layout 1, after clicking the button, you should be switched to Page Layout 2.
Another Way:
1. Please create a formula field and keep return type a text.
2. Now you can write your logic to show a button image if the status is New otherwise put NULL so that nothing would be visible. Or you can show an image of grayed button.
3. you can embed an URL on clicking on this formula field so that a new VF page can be hit you can update status and it will get back you on the same page.
Here is sample code
Hope this helps you!
Best Regards,
Jyothsna
Its a detail page button.
Regards,
Pallavi
i have added a custom button and written the logic to change the stauts. I need to know how to hide the button based on the status value. And i tried created a formula field but picklist fields are not accepted in the condition.
Regards,
Pallavi
The idea of image formula field works good but I caanot view the image in Communities. I stored the image as a static resource.
Access:Public
Any solution?
I tried creating it as a document and Externally Available Image: True. I have a folder with images visible to everyone.It worked. I can see it in communities.Let me know If this helped.Thank you