Page 2 of 2

Re: [RPG/RDMLX]Retrieve Device name

Posted: Tue Jul 17, 2018 10:22 am
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));                    
    }
)