[RPG/RDMLX]Retrieve Device name

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
MegumiSawada
Posts: 268
Joined: Tue Feb 19, 2013 5:18 pm

[RPG/RDMLX]Retrieve Device name

Post by MegumiSawada »

Hi,

Is it possible to get Device Name from LongRange?
IMG_1080.PNG
IMG_1080.PNG (14.93 KiB) Viewed 12677 times
Regards,
Megumi Sawada
jasonzhou
Posts: 130
Joined: Wed Jan 11, 2017 3:26 pm

Re: [RPG/RDMLX]Retrieve Device name

Post 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
MegumiSawada
Posts: 268
Joined: Tue Feb 19, 2013 5:18 pm

Re: [RPG/RDMLX]Retrieve Device name

Post 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
jasonzhou
Posts: 130
Joined: Wed Jan 11, 2017 3:26 pm

Re: [RPG/RDMLX]Retrieve Device name

Post 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
MegumiSawada
Posts: 268
Joined: Tue Feb 19, 2013 5:18 pm

Re: [RPG/RDMLX]Retrieve Device name

Post 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
soapagent
Posts: 93
Joined: Mon Jul 16, 2012 6:19 pm

Re: [RPG/RDMLX]Retrieve Device name

Post by soapagent »

This would be a good piece of functionality in LANSA Mobile (which is a close relative of Longrange) as well.
Jim
soapagent
Posts: 93
Joined: Mon Jul 16, 2012 6:19 pm

Re: [RPG/RDMLX]Retrieve Device name

Post 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?
jasonzhou
Posts: 130
Joined: Wed Jan 11, 2017 3:26 pm

Re: [RPG/RDMLX]Retrieve Device name

Post 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
soapagent
Posts: 93
Joined: Mon Jul 16, 2012 6:19 pm

Re: [RPG/RDMLX]Retrieve Device name

Post by soapagent »

Thanks Jason, I'll have a play with that as soon as I can.
soapagent
Posts: 93
Joined: Mon Jul 16, 2012 6:19 pm

Re: [RPG/RDMLX]Retrieve Device name

Post by soapagent »

Would this work from a VLWEB Widget?

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