Hiding an element(button) for a specific account in Self-Service Portal

Hiding an element(button) for a specific account in Self-Service Portal

The below scripts meets the requirement of hiding an element in the requesters' Self-Service Portal, account-specifically. 


Script

function hideEle() {  
 var accountid= document.getElementById("requesterAccountId").value;
if(accountid=='3'){                                                                      //Use Account id to which the change need to be applied
   document.getElementById("pc_20").className = "hide"; //Replace pc_20 with the element id which need to be hided.
   }
}
setTimeout( hideEle ,500); 
Remove the text in blue colour (comments) from the script before saving the script.
 
Kindly follow the below steps: 

1. Kindly note the account ID and element ID as shown below, 

Navigate Accounts >> Select the desired account >> Note the account ID from the URL. 


Navigate Home >> Customize >> Requester Homepage View >> Select a desired template >> Edit >> Hover the cursor over the element you would like to hide >> Right-click and inspect the page. 

Here, I hovered over the "I am facing an Issue" button and right-clicked to inspect. The highlighted text under the inspector is the element. Find the element ID(marked with an arrow in the above image)

2. Navigate Admin >> Developer's Space >> Page Scripts >> New Rule, configure based on your requirements and the script by modifying the required IDs. 


3. Login as the requester who belongs to the mentioned account ID and refresh the page once to see the change. 




                  New to ADManager Plus?

                    New to ADSelfService Plus?

                      • Related Articles

                      • How to customize the self service portal fonts

                        Under Admin>Self Service Portal>> Click on Customize Self-Service Portal Click on Edit  You can edit the below marked tag and customize it to your desired font and size.    <h1 style="font-family:Comic Sans MS; color:powderblue;">{{i18n ...
                      • How to change image in Self Service Portal (Requester Login)

                        1. Under ManageEngine\ServiceDeskPlus-MSP\custom\widgets\SSP\search_widget paste the image you want to replace. 2. In the application, Under Admin>Self Service Portal>>Self Service Portal Customization>> Click on Edit  You can view the script on the ...
                      • Set Background color for Self service portal page

                        To set the Background color for Self service portal page, login to the application as an administrator, goto Admin- Self service portal settings . Click on Customize Self service portal, and click on Edit. If you have already set any background image ...
                      • How to use URL ( external link ) in the service catelog - service templates in self service portal

                        The application has an option to add link in the self service portal customization. But if the requirement is to add the URL inside the below templates The requirement is that , to have a specific template that can redirect to an external URL and not ...
                      • How to change the color of the Login button ?

                        Navigate to Admin->Self-Service Portal Settings->Login page customization and Add the below class under style as shown below, .btn-primary { background-color: #6600CC; } Above color code is for Purple, please use the appropriate color codes. After ...