Barcodes, UI Actions, Record Producers, and Mobile - Oh my!

Darth Jed
Tera Guru

Once again, I find myself doing some custom scripting that flies way outside the norm of what ServiceNow expects you to do. I am trying to allow mobile Field Services users to scan barcodes on a record producer that was triggered by a mobile UI action. The UI action also passes in variables from the work order task to the record producer via the URL parameters.

  1. User views the work order task on their phone in the native app.
  2. From the main form of the task, not the detail screen that precedes it, the user touches the actions ellipsis icon and then touches the UI action to trigger the record producer.
  3. The record producer opens up, retrieves the variables from the URL via client script, and displays the barcode enabled string fields.

However, when the record producer is triggered from the UI action, the barcode fields do not display their icons that open the camera to capture the barcode. If the user opens the record producer from the catalog, the icons are displayed, but then the task details are not passed to the record producer.

I know I can have the user enter their task number in the record producer and populate the form that way. I'm trying to solve the barcode scanning problem and make it easier on the field user to access the form.

This is what one of the record producer fields looks like when triggered from a UI action.
find_real_file.png

This is the same field after opening the record producer from the catalog.
find_real_file.png

I've tried all the ways of opening the record producer that I can think of. This is my current UI action script. 

var params = 'sysparm_cmdb_ci=' + current.parent.cmdb_ci.sys_id + '&sysparm_task_number=' 
              + current.sys_id  + '&sysparm_ci_model=' + 
              current.parent.cmdb_ci.model_id.getDisplayValue();
var url = 'com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=46c6894adb069b002be712261b961986'; 
action.setRedirectURL(url + '&' + params);

Has anyone else run into this obstacle and fixed it?

7 REPLIES 7

Jace Benson
Mega Sage

Can you make a small update set to set this up on a PDI so I can test it out?

I've attached the update with the bare minimum code to reproduce the issue. You will have to turn on Field Services and Mobile to get the rest of the elements that reproducing the issue will require. The UI action requires the work order task that you trigger it from to be in the work in progress state.

Thanks.  I'll give it a go and come back to this.

Okay I'm having the same trouble.  The URL must be "different" on mobile  It seems taht this is all controlled (and you can test) using a differnt browser and pointing to $m.do or $mobile_webview.do

and the url for the item in your update set is;

https://dev32369.service-now.com/$mobile_webview.do#/catalog/e0d08b13c3330100c8b837659bba8fb4/category/e15706fc0a0a0aa7007fc21e1ab70c2f/item/a4210c1cdb1adf008b61ae441b96191e

 

However I still don't get the form to load how i'd expect it.  Have you opened a HI incident?  You *should* be able to do this with one of the two links.