- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2021 09:41 AM
Hi guys,
In the NOW Mobile, I am trying to create a push notification, that will take me to the /mesp portal and display a ticket, e.g. an incident.
With a formscreen it is easy, and you do the deepLinkGenerator.getFormScreenLink. No problems, but if I want a custom url I can't get it to work. In the Classic app it supported "web_path", and it could be configured something like this:
var json = {};
json = {
"aps" : {
"sound" : "default"
},
"web_path" : "/mesp?id=mobile_ticket&table="+current.getTableName()+"&sys_id="+current.getValue("sys_id")
};
return json;
But I can't get that to work in the NowMobile. Honestly the documentation on the properties in the JSON object is... lacking. And you can link to screens in different ways, by using the property "Redirection" (using documentId as formscreen) or "Link" (Having the link generator).
Do any of you know a way to configure the push notification to redirect the user to a portal page, instead of a form screen? Just as it is possible in the app clicking on a list item, and then have a function instance to redirect the user?
Best regards,
Sebastian Laursen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 06:01 AM
Webpath is not supported in NOW Mobile.
In Rome there will come an option to do the same as webpath in the NOW Mobile.
So to do this now, you need to be on the Quebec version and you can use the deepLinkGenerator.getFormScreenLink. Make sure the sys_id in the parameter is a browser screen and it will auto translate e.g. {{sys_id}} from the push notification.
This does NOT work on the Paris release, where it can't translate the {{sys_id}} for some reason. I've tested this out on several instances, and also with the same records. When upgrading to Quebec this works, but on a Paris instance it can't get the value. Configuration of push notification message content. You can replace the "Agent" with "request" if you wish to have the NOW Mobile.
(function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {
var layoutFieldGenerator = new global.NotificationLayoutFieldGenerator();
var identifier = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "number");
var description = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "short_description");
var status = layoutFieldGenerator.layoutField(current.sys_class_name, current.sys_id, "priority");
var json = {};
var deepLinkGenerator = new global.MobileDeepLinkGenerator("Agent");
//var link = deepLinkGenerator.getFormScreenLink('9f045535532033002d96ddeeff7b127b', current.getTableName(), current.getValue("sys_id"));
var link = deepLinkGenerator.getFormScreenLink('5d035caf2f3320103eb45e492799b6f3', current.getTableName(), current.getValue("sys_id"));
json = {
"aps" : {
"sound" : "default"
},
"Link": link,
"Layout" : {
"Status": status,
"Identifier" : identifier,
"Description" : description
}
};
return json;
})(current, message, attributes);
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2021 11:37 PM
Do you have a page called mobile_ticket? Try to change the url to /mesp?id=ticket&table=incident&sys_id={{sys_id}}
Also make sure that it is the correct sys_id you are setting in the getFormScreenLink (the browser screen)
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2021 12:26 AM
I have entered correct sys_id there , yes I have made a browser applet also , and tried using this URL also /mesp?id=ticket&table=incident&sys_id={{sys_id}} but still its not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2021 10:17 PM
Please let me know if you were able to resolve this issue. Trying to configure the same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2021 10:16 PM
Hi I am facing same issue -
given correct mobile web screen (url applet )g sysid in getFormScreenLink with dynamic sys_id
giving error "error loading url"
sometimes loading the screen but not passing dynamic sys_id.
Could you please assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2021 10:42 AM
So this is my browser screen, where I dynamically can link to the class and sys_id of the origin of the notification.
The Push notification message needs to have the correct Push App, and you need to have the notification in the "Push Default Registrations". Also Relative URL needs to be true.
Make sure you have the correct sysID of the applet:
This is the message content of the Push notification (make sure to get the value of the sys_id as a string):
Best regards,
Sebastian Laursen