- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2017 02:25 AM
Hello,
My custom application has its record producer (a colleague of mine created it). It serves as a registration form for none users.
If I click on its Preview Item — the form pops up. Its Top Bar contains two buttons: Back & Attachment (paperclip) along with the title of the form: "xxx Request Form".
For references — please check the below screenshot:My goal is to remove / hide the two buttons from there and leave only the title.
I reviewed all similar threads (about Attachment button, etc.) in the Community and tried all the scripts proposed there. None of them, but one worked. And it does not hide the Paperclip button, but simply disables it.
The other option which I used was to create a Variable Set and associate it to my record producer and then create an onLoad Catalog Client Script for the Variable Set with the following function:
function onLoad() {
$j('tr.sc_header').hide();
}
I saw this action in one of the threads: Re: Hide Header in Record Producer form.
As I understand — it should remove the whole header bar or in other words: not only the buttons, but also the title of the form. Yet, this also does not work…
I do not have any other ideas or approaches, but to ask for your help and expertise, SNOW fellas.
Could you please assist me with the removing of the two buttons from the Header Bar of my custom Record Producer, but leaving the title of the form?
Best Regards,
Georgi Mavrodiev
IT Consultant
Do IT Wise
You may visit us in our Web Site: www.doitwise.com
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2017 10:41 PM
Hi Georgi,
The if condition can be written.
You have the catalog item name in the script tag. Add following
add following lines after this line of code catalogHistory.setHistory('$[HTML:sc_cat_item.name.getDisplayValue()]', catalogHistory.getPageUrl() + '$[AMP]sys_id=$[sysparm_id]');
Replace Something Broken with the name of your catalog item
if("$[HTML:sc_cat_item.name.getDisplayValue()]" == "Something Broken"){
$j("back_button_in_header").hide();
$j("sc_attachment_button").hide();
}
So this will run only when catalog item matches your name and hide the buttons. for other it won't
i have verified and tested this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2017 10:45 AM
Hi Georgi,
Were you able to achieve your requirement? If yes then please mark the answer as correct, helpful and hit like. This helps in closing the thread for the question. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2017 10:48 AM
Hi Ankur,
I marked your answer as the "Correct Answer" several weeks ago
The thread is long closed.
Best Regards,
Georgi Mavrodiev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2017 10:55 AM
Hi Georgi,
Sorry for that. I forgot that it has already being marked as correct. Could you please endorse the content for high visibility in community. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2017 01:06 AM
Hi Georgi,
Is there any way to hide the back button for normal forms like incident and change?
Thanks,
Shahid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2017 01:32 AM
Hello Shahid,
To do so, you need to create a Client Script with Type onLoad.
Do the following:
- user the Application Navigator and navigate to System Definition > Client Scripts;
- click on New;
- add a name, for example: "HideIncidentBackButton";
- fill in the Table item with the incident table: Incident[incident];
- Type: onLoad;
- give it a Description, for example: "Hide the BackButton in the incident form";
- add the following in the Script item:
function onLoad() {
document.getElementsByClassName("btn btn-default icon-chevron-left navbar-btn")[0].style.display="none";
}
You may check the below screenshot for references, I've just made this client script and tested it in my DEV Instanbul envy:
Please perform a test and let me know if the result suits you. Thank you!
Best Regards,
Georgi Mavrodiev
IT Consultant
Do IT Wise
You may visit us in our Web Site: www.doitwise.com