GlideMobileExtensions.getDeviceType() intermittently does not show device type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2016 03:13 AM
We are using the following code in a business rule:
GlideMobileExtensions.getDeviceType()
It shows what device type is being used, and in our BR we are setting a delivery address to be the 'requested for' if a mobile is used.
We have seen that intermittently the device type is not captured, therefore when someone on a mobile does orders something, its not setting it as 'm' therefore our code doesn't run to set the delivery address.
Has anyone come across this before? Any advice to get it so it sets it all the time?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2016 07:17 AM
Hi Pennie,
I'm trying to use GlideMobileExtensions.getDeviceType() in a Business Rule to return the Device being used but not having much luck with it.
Not as straight forward as: var device = GlideMobileExtensions.getDeviceType();....?
Ashley
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2016 01:23 AM
Hi
This is what I did:
var deviceType = GlideMobileExtensions.getDeviceType();
It either comes out as 'm' for mobile or 'doctype' for desktop. Sometimes it comes out blank even though the mobile has been used.
Are you getting nothing every time? Can you test on another mobile/desktop?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2016 09:22 AM
Yeah that is what I am trying but it's currently not doing anything .... in a Business Rule on a Record Producer
Run on Display
Table: Record Producer {sc_cat_item_producer}
No Condition (So it runs everytime)
Script:
(function executeRule(current, previous /*null when async*/) {
var deviceType = GlideMobileExtensions.getDeviceType();
if (deviceType == "doctype") {
//current.approval_source = "ui.mobile";
g_form.setDisplay('user_company', false);
g_form.setDisplay('user_location', false);
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2016 05:26 AM
Hi
From what that script looks like your trying to capture the device type on the actual item, before its been submitted? MMhhh not sure you will be able to...you may need to convert the script to a catalog client script and see if you can get it working from there? might mean a slightly different command than 'GlideMobileExtensions.getDeviceType();' but you could try it?