
Hey Folks,
Don't know if this is even possible or not, but doesn't hurt to ask!! As we have users in our Org who use a laptop and/or an iPhone/Android device, we're trying to see when records are created which device they are created on. Is there some sort of identifier that captures that? Or if not, can something like that even be created? Like I said, not sure it's possible, but...
Thanks in advance!
Joe
Hi Joe,
I don't think there is any existing mechanism that stores this information at record level, however you can refer some Analytics from admin.powerlatform.com (ref. docs.microsoft.com/.../analytics-common-data-service which will provide details based on overall system.
However to create something like that you can follow below steps(for New Records).
1. Create a new field (Single line text ) to store the device type for required table.
2. Write a script and call it onLoad of Form.
function UpdateDeviceTypeOnLoad(executionContext){
var formContext = executionContext.getFormContext();
if(formContext.ui.getFormType() === 1) // 1 = create
{
var clientContext = Xrm.Utility.getGlobalContext().client;
var kindofDevice= clientContext.getFormFactor();
switch(kindofDevice){
case 0 :
formContext.getAttribute("NEWFIELD").setValue("Unknown");
break;
case 1 :
formContext.getAttribute("NEWFIELD").setValue("Desktop/Laptop");
break;
case 2 :
formContext.getAttribute("NEWFIELD").setValue("Tablet");
break;
case 3 :
formContext.getAttribute("NEWFIELD").setValue("Mobile");
break;
default:
formContext.getAttribute("NEWFIELD").setValue("Unknown");
}
}
}