showmessagebox on android tc52x

Solved
JW

Hi. 

Not sure why/how showing messages on tc52x is not working.

This works:
    showmessagebox "Your device IP address is %IP%"

This does not:
    set Project=TestV2.0.1.6
    showmessagebox "Installed Project: %Project%"
    Result: Installed Project: %Project%

I am on MobiControl 15.5

15.5 Help Link doesn't seem to help much... 

Help show example for user responses but yet it doesn't work: 

To provide followup actions to a user response to message box:

showmessagebox "Abort the operation?" NO_TIMER 2 YES
if %ShowMessageBoxReturn% == IDYES goto Exit

1. How do I display a dynamic message (using variables)?

2. How would I get user input if "It cannot return the user response" (from the help)

Thanks.

2 years ago
SOTI MobiControl
ANSWERS
TE
Travis Epperson
2 years ago

Any interest in using JavaScript?  I'm afraid I have never found the legacy script useful for user interaction.

-----

function UserAproval() {
    mobicontrol.message.createTextPromptDialog('Abort the operation?)')
        .withTitle("Abort?")
        .withNotification()
        .withDefaultText("")
        .withButtons('Yes', 'No')
        .withTimer(30000)
        .withCallback(Userfeedback).show();
}

//This is triggered once the user prompt is gone.  If the user said Yes do not move forward
function Userfeedback(result) {
    if (result.buttonLabel == "Yes") {
        mobicontrol.log.info("Abort!");
    } else {
        StuffToDo()
    }
}

JW
James Wisecup
2 years ago
Solution
RC
Raymond Chan Diamond Contributor
2 years ago

The "set' legacy script command seems to be not supported any more for recent Android device agents.  Actually, such command had some limitations even in earlier versions, and was not supported in all scenario in which legacy scripts can be used.