Receive Purchase Order Line Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2015 10:00 AM
We recently ran into an issue on the Purchase Order form when trying to receive PO Line Items where the individual items would not change to a Received status.
We recently upgraded to Eureka Patch 7 Hotfix 2, with plans to go to Patch 8 in a couple weeks. The functionality worked prior to the upgrade and wasn't discovered by our QA team in our lower instances. The code in question comes with the Procurement plugin, and while the Wiki only calls out enhancements as part of Dublin, the version date is as of our upgrade date. Before I get into the details, I'll throw out the other odd ball thing we found in testing. Our instances all started out as Berlin and have gone through upgrades of Calgary, Dublin, and Eureka. We recently got a new instance which is OOB Eureka that we installed the Procurement plugin to as a baseline to test against. In this instance, the functionality works just fine or seems to.
Ok, the guts of the issue/question. Walking from the UI Action 'Receive' off the Purchase Order table (proc_po), you get to the UI Page 'receive_order' that's brought up in a dialog window. Following the code, the 'OK' button calls the function submitChanges() in the Client Script and this is where the problem seems to be. The first part of that function reads as:
/*
if ($j("#submit_popup").hasClass("disabled"))
return false;
*/
So the submit_popup is the id of the 'OK' button and this line is checking to see if it has a class of disabled. Two things here:
- What is the # for before the element id? I don't remember ever seeing that in Jelly class and can't find any other scripts that look similar.
- In the HTML section, disabled is never defined as a class.
Later in the function the submit_popup element does have the class of disabled added to it through the line:
// $j("#submit_popup").addClass("disabled");
In the HTML, Client script, or Processing script of the UI Page, the class of this button is never referenced, called or, passed to another piece of code. That leads to the big question, why is it there?
To get the UI Page to properly function and successfully receive a PO Line Item, we commented out the above code with regards to submit_popup. Again, this worked prior to our Eureka upgrade (Dublin Patch 3) and does work on a fresh Eureka instance with the Procurement plugin installed. We're good with leaving it commented out but, just want to check as to the potential issues we might open ourselves to in doing so. It would be nice to understand why the code is there and what it's trying to accomplish. Is there something missing in the HTML code that should be setting that button to disabled based on specific criteria?
Any thoughts or comments are greatly welcomed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2015 11:32 AM
So just wanted to add some information. While we're on Eureka, we're still using UI 11, not UI 14. Heard back from SN on HI ticket and issue might be UI related and potential an existing Problem ticket on this. I'll add more info as I hear from that end.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2015 01:01 PM
Using UI11 as well, Same Eureka Patch Level. So i'm going to post the fix here just in case others run into the same issue.
jQuery is not loaded on that UI Page, so that's why it doesn't work.
The simplest solution is:
UI Pages -> receive_order ->
HTML/XML section Change
From
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:ui_form>
To
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:requires name="scripts/lib/jquery_includes.js"/>
<g:ui_form>
You will also have an issue with "Blank" Stock Rooms
So to fix that you can either add a "Stock Room Type" to all your stock rooms or
From
var gr2 = new GlideAggregate("alm_stockroom");
gr2.addQuery("type", "!=", "Field Agent");
gr2.query();
To
var gr2 = new GlideAggregate("alm_stockroom");
<!--gr2.addQuery("type", "!=", "Field Agent");-->
gr2.query();
Hope that helps
Almost forgot
Credit to Raymond Beijerling for the tip on how to include jQuery into ServiceNow (How to use - JQuery in UI Page?)