- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 07:50 AM
from the sc_task table, I have the following:
function onLoad(){
var reqitem = g_form.getReference('request_item');
//alert(reqitem.cat_item);
if (reqitem.cat_item == ('hardcodedsysidpleasedontshootme') || reqitem.cat_item == ('ipromisetomovethistoasysproperty'))
{
so I know from the Task, I can get the request_item as it is on the form and from that reference I can get the cat_item
But up a level, if I want to get the cat_item from the sc_req_item itself !! It is not present on the form so how I can access it?
Should I just add the item to the form?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 08:10 AM
I have found that if a field is not available on the form it is not found using g_form methods. You could make the field available on the form, then create a UI Policy that hides it since it probably is not needed on the sc_req_item form. Then your g_form methods will work.
Let us know if you are still unsuccessful,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 08:10 AM
I have found that if a field is not available on the form it is not found using g_form methods. You could make the field available on the form, then create a UI Policy that hides it since it probably is not needed on the sc_req_item form. Then your g_form methods will work.
Let us know if you are still unsuccessful,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 08:12 AM
Gah! The community needs "presence" like ServiceNow does so I know you are typing at the same time.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 08:11 AM
Hi,
You need to add the field on the form in order to fetch the value at client script. However, once the field is added to the form, you can create a UI policy in order to show/hide the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2016 08:26 AM
thanks guys ! sorry pradeep he beat you by 1 minute... i thought this was the case... its a bit mucky really
I think ctomasi has an enhancement request / petition for enhancing the g_form which would be lovely