Hi! Is there a NS Module we can use to store the l...
# suitescript
j
Hi! Is there a NS Module we can use to store the location where an SO is saved from SCA?
b
if you mean physical location, then no
you would need to use the Geolocation API in the browser
j
Thanks @battk — I'm new with Geolocation API, and I tried to call it using Client Script on NS standard SO record, but seems like this API is not available. Any idea on how we can import it?
b
what did your attempt look like
j
I simple call the object in pageInit:
function pageInit(scriptContext) {
try {
if (navigator.geolocation) {
var currentLoc = navigator.geolocation.getCurrentPosition();
console.log(currentLoc);
}
} catch(e) {
log.error('error', JSON.stringify(e));
}
}
My bad! Was able to make it work 🙂 Thanks for the help