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

Re: [RPG/RDMLX]Retrieve Device name

Post by jasonzhou »

The following demo code may work for you:)

JavaScript code:

Code: Select all

function getDeviceName(){
    LONGRANGE.Form.runOperation({
        operation: {
            type: "execScript",
            Resource: "LRECL_GetDevName.js"
        }        
    });
}

function onLongRangeFormDataSet(userData){
    alert(userData["DEVICENAME"]);    
}
ECL code (LRECL_GetDevName.js)

Code: Select all

lrexec(            
    function()
    {
        this.q_getSystemValue("DEVICE-NAME");
    },
    
    function(result)
    {
        this.q_setProperty("form.fields.MyWebView.Data.DEVICENAME", JSON.stringify(result,null,4));                    
    }
)
Post Reply