Kirix Support Forums

close form/script

Please post any help questions, requests or other feedback here.

close form/script

Postby abenitez77 on Mon Jul 02, 2012 6:34 pm

I have a script that creates a form . I have a check at the beggining of the form to see if the user is a Project Admin, if not then I want the form to close right away. I cannot get it to close.


use strict variables;
use strict semicolons;

//var db_output = HostApp.getDatabase();

var f = new ControlsForm;
f.center();
f.show();
Application.run();


class ControlsForm extends Form
{
...
...
function ControlsForm()
{
...
...
var EnvUserID = Environment.getEnvironmentVariable("USERNAME");
EnvUserID = EnvUserID.toUpperCase();

// Get Userid to see if it is a Project Admin

var ProjAdmin = dbP.execute("Select UserID From ProjectAdmins");

while (ProjAdmin.next())
{

myUserID = ProjAdmin.UserID.toUpperCase();

if (myUserID == EnvUserID)
{
isadmin = true;
}
}

if (isadmin == false)
{
alert("You don't have rights to add new projects");

//return;
//onButtonExitClicked();
Application.exit();

}
abenitez77
Registered User
 
Posts: 143
Joined: Fri Jan 21, 2011 12:42 pm

Re: close form/script

Postby Ben on Tue Jul 03, 2012 10:59 am

Hi there,

Can you try calling

Code: Select all
this.close()


You can see the full documentation for the Form class here http://www.kirix.com/docs/Form.html

All the best,
Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Return to Strata Help & Feedback