Page 1 of 2

[RPG/RDMLX]Retrieve Device name

Posted: Thu Sep 07, 2017 4:32 pm
by MegumiSawada
Hi,

Is it possible to get Device Name from LongRange?
IMG_1080.PNG
IMG_1080.PNG (14.93 KiB) Viewed 12682 times
Regards,
Megumi Sawada

Re: [RPG/RDMLX]Retrieve Device name

Posted: Fri Sep 08, 2017 9:29 am
by jasonzhou
Hi Megumi,

It's feasible on iOS.

As for another 2 platforms Android and Windows, the device name is a little different from iOS. On Android, the model name will be get as device name; On Windows, the PC Name will be get as device name.

Thanks
Jason

Re: [RPG/RDMLX]Retrieve Device name

Posted: Fri Sep 08, 2017 10:52 am
by MegumiSawada
Hi Jason,

Thank you for your reply.
The customer uses iOS.
Could you please let me know how we can retreive Device name on iOS?
It's not in SystemInfo...

Best Regards,
Megumi

Re: [RPG/RDMLX]Retrieve Device name

Posted: Fri Sep 08, 2017 11:14 am
by jasonzhou
Sorry Megumi, my last answer is not clear. I meant we can implement this function in next release, however, current build hasn't had this function implemented yet.

Thanks
Jason

Re: [RPG/RDMLX]Retrieve Device name

Posted: Fri Sep 08, 2017 12:00 pm
by MegumiSawada
Hi Jason,

Sorry that I misunderstood your previous reply.
I'll send an enhancement request regarding this via support.
Thank you!

Best Regards,
Megumi Sawada

Re: [RPG/RDMLX]Retrieve Device name

Posted: Fri Sep 08, 2017 1:03 pm
by soapagent
This would be a good piece of functionality in LANSA Mobile (which is a close relative of Longrange) as well.
Jim

Re: [RPG/RDMLX]Retrieve Device name

Posted: Sat Jun 23, 2018 7:36 pm
by soapagent
New system value DEVICE-NAME for getting the name of client device

How does this work. Is this a system value like *DEVICE-NAME? I found q_getSystemValue in the docs but how do I access this in RDMLX?

Re: [RPG/RDMLX]Retrieve Device name

Posted: Wed Jun 27, 2018 10:46 am
by jasonzhou
Hi Jim,

q_getSystemValue is an ECL function, you can use ExecScript operation to execute an ECL script. Please try out the following example to get device name in RDMLX

RDMLX

Code: Select all

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #LRNG_FORM)

Mthroutine Name(HandleRequest) Options(*REDEFINE)
Define_Com Class(#Prim_Alph) Name(#EnteredText)

#COM_OWNER.Using Element('/Form.Fields')

#COM_OWNER.Set_Form Grid_Col_N(1) Grid_Col_Width(Fill)
#COM_OWNER.Set_Button Name("GETDEVNAME") Text("Get Device Name") Layout_Col(1) Layout_Row(1)
#COM_OWNER.Set_Label Name("RESULT") Layout_Col(1) Layout_Row(2) Color("Red")
#COM_OWNER.Set_Op_ExecScript Event(GETDEVNAME.OnClick) Resource(LRECL_GetDevName.js)

#COM_OWNER.EndUsing

Endroutine

End_Com

LRECL_GetDevName.js

Code: Select all

lrexec(            

    function()
    {
        this.q_getSystemValue("DEVICE-NAME");
    },
    
    function(result)
    {
        this.q_setProperty("form.fields.RESULT.Value", JSON.stringify(result,null,4));                    
    }
)

Thanks
Jason

Re: [RPG/RDMLX]Retrieve Device name

Posted: Thu Jun 28, 2018 9:36 am
by soapagent
Thanks Jason, I'll have a play with that as soon as I can.

Re: [RPG/RDMLX]Retrieve Device name

Posted: Wed Jul 11, 2018 11:11 am
by soapagent
Would this work from a VLWEB Widget?

var device = this.q_getSystemValue("DEVICE-NAME");