Using Scripts in K2 form button click events

  • 21 January 2019
  • 3 replies
  • 25 views

Badge +5

Hi all,

I am from  SP 2010 to SP 2016 migration team. We are basically converting the Nintex form to K2 form. We are often using the K2 in SP 2016. In SP 2010 Nintex form, two buttons (Javascript button)   are available. Below mentioned each button click function. (What is that script does actually). So please tell how to implement that in SP 2016 with K2 forums. 

 

1st button click event:

runProgram()
function runProgram()
{
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "C:/Program Files/RealVNC/VNC Viewer/vncviewer.exe";
oShell.ShellExecute(commandtoRun,"IP Address","","open","1");
}
 
2nd button click event:
var objShell = new ActiveXObject("WScript.Shell"); objShell.Run("%comspec%"+" /K \TMPH001MMAIP1AndonScreenShotRestart_vsemulator.bat IP Address");
 
I have attached the screenshot for your reference.

Could anybody offer any advice on how I could achieve the above on my form?

 

Many thanks

Kanagaraj.


15514iB6A1C4CE355CBA92.png
12689i2DD1482A345FFAA1.png


3 replies

Userlevel 6
Badge +16

Hi,


 


The scripts don't appear to be related to K2. I would recommend reaching out to Nintex folks or Nintex community forum on this. A quick google on this points to VNC Viewer, it looks to be file transferring event using VNC Viewer application.

Badge +10
HI Kanagaraj,

What exactly are you trying to do with the above scripts on button click?
Badge +9

Hello Kanagaraj,

 

For Executing javascripts on button click in K2 smartforms, Please have a look at below samples and see if it helps you.

 

https://vijaydk2guy.wordpress.com/2017/06/02/basic-jqueryjavascript-samples-in-smart-forms/

 

Regards,

Vijay.

Blog: https://vijaydk2guy.wordpress.com

Reply