20 views

Description

g_form.getElement returning undefined, starting in the Kingston release

Steps to Reproduce

1. Go to Service Catalog > Maintain Items
2. Click New.
3. Name: TestItem
4. From the header bar, save the record.
5. In the Variables related list, click New.
6. Type: Multiple Choice
Question: test question
Name: question_test
7. From the header bar, save the record.
8. In the Question Choices related list, click New.
Order: 100
Text: Manually enter
Value: Manually
Click Submit.
9. Create another Question Choices record.
Order: 200
Text: Attach a file
Value: Attach
(The Attach value must be title case because it's used in the Catalog Client S
Click Submit.
10. Go to Service Catalog > Catalog Client Scripts
11. Click New.
12. Name: Open Attachment Window
Applies to: A Catalog Item
UI Type: Desktop
Type: onChange
Catalog Item: TestItem
Variable name question_test
Applies on a Catalog Item view (checked)
Script:
[code]<pre><code>function onChange(control, oldValue, newValue, isLoading) {<br/>
var attach = g_form.getValue('question_test'); <br/>
if (attach == 'Attach') {<br/>
saveCatAttachment(g_form.getElement('sysparm_item_guid').value, 'sc_cart_item'); <br/>
alert( "g_form: " + g_form.getElement('sysparm_item_guid').value); <br/>
}<br/>
}</code></pre>[/code]

13. Click Submit.
14. Go to Service Catalog > Maintain Items
15. Sort in descending order by Updated.
16. Open the TestItem catalog item you created in Step 3.
17. Click the Try It button.
18. Toggle the Attach a File radiobutton.

Expected behavior: The alert popup should show a value after g_form:
For example:
g_form: a7b11417db1a5b40d570594e5e9619cc
And, after closing the alert, you will be able to successfully attach a file.
This works as expected in Istanbul and Jakarta.

Actual behavior: Starting in Kingston, the alert statement shows g_form: undefined. And, after closing the alert, you won't be able to attach a file.

Workaround

This issue is under review. To receive notifications when more information is available, subscribe to this Known Error article by clicking the Subscribe button at the top right of the article. If you are able to upgrade, review the Fixed In or Intended Fix Version fields to determine whether any versions have a planned or permanent fix.

 


Related Problem: PRB1285111

Seen In

There is no data to report.

Fixed In

London

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-08-24 01:12:42
Published:2018-08-15