- 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
04-26-2017 02:45 AM
Hello again, Shahid,
If your test with the Incident form is successful, then the Incident scenario of yours is covered.
Now, you may address the change scenario.
Simply follow the same steps and create a new onLoad Client Script.
This time, choose the Table filed to be Change Request[change_request].
Use the same script. Everything has to be same but the table.
Once you create the new onLoad Client Script - navigate to Change via the Application Navigator and perform a test by opening one of the Opened change records.
If the Back Button is not presented there - then the test was successful, and both of your scenarios were covered.
Best Regards,
Georgi Mavrodiev
IT Consultant
Do IT Wise
You may visit us in our Web Site: www.doitwise.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2017 03:04 AM
Hi Georgi,
Awesome, that worked.
I never thought i would be able to do that through class attribute.
Thanks a lot.
Shahid