Alpha Video Training
Results 1 to 6 of 6

Thread: "Object Is Not Defined" Error When I Use "Close Form" in the "OnInit"

  1. #1
    Member nigeldude's Avatar
    Real Name
    Nigel Freeman
    Join Date
    Jul 2006
    Location
    Belize City, Belize
    Posts
    289

    Default "Object Is Not Defined" Error When I Use "Close Form" in the "OnInit"

    I managed to figure out that Im getting the "Object Is Not Defined" error as a result of using the "Close Form" or Close Window action on a dialogues Onit. I have a main form "POS", From there when an Item is scanned or type to be entered in the invoice, the "Product Lookup" dialogue is launched which does the query and return the appropriate vales to the POS form. At the end of the onit codes is a close form action which cause the error I cant get rid of; "Object Is Not Defined".
    Please have a look at the attached screenshot.
    Would really appreciate any assistance very much.
    Attached Images Attached Images

  2. #2
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: "Object Is Not Defined" Error When I Use "Close Form" in the "OnInit"

    So Nigel you explained the error, then a screenshot of the error.
    From that we know for sure that code on line 29 is using an undefined object.
    From what you've given that's all I can tell you.

  3. #3
    Member nigeldude's Avatar
    Real Name
    Nigel Freeman
    Join Date
    Jul 2006
    Location
    Belize City, Belize
    Posts
    289

    Default Re: "Object Is Not Defined" Error When I Use "Close Form" in the "OnInit"

    I have no idea what "undefined" means here, I used the action scripting and fill in all the fields. Wen the very same code is converted to xbasic and place in the onkey event, it works fine, but when its place under a button it gives the error. why the difference. and, if i remove the "close form code" and launch the dialogue then manually close it after all the oninit code is executed, it works well there too. Why do.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: "Object Is Not Defined" Error When I Use "Close Form" in the "OnInit"

    I'm unclear about what you're attempting but the oninit wouldn't be a place to issue a close form. The oninit happens as the form display is initialized. At that time some objects may well not be defined and placed into memory.

    Would the onactivate event handle whatever it is you want to do?
    There can be only one.

  5. #5
    Member nigeldude's Avatar
    Real Name
    Nigel Freeman
    Join Date
    Jul 2006
    Location
    Belize City, Belize
    Posts
    289

    Default Re: "Object Is Not Defined" Error When I Use "Close Form" in the "OnInit"

    I tried the codes in the "onactivate", they weren't triggered.

    Basically what I'm trying to accomplish (and have accomplished except for the error at the end after everything has been executed) is; I need a modal dialogue to open up, by pressing enter on the keyboard, by passing a product in front of a bar code scanner or pressing a certain button on the main form. When this dialogue opens up, a series of codes in the "Oninit" is to be executed, and after all have been done, the dialogue is to close.
    Right now the bar code scanner opens the dialogue, execute the codes and close the form flawlessly. Pressing the enter button on the keyboard does also, but pressing the desired button on the form opens the dialogue, executes the codes, but when it reaches the action script to close the dialogue it pops up that error message.

    Whats most confusing is; its the very same set of codes that are in the dialogue's oninit regardless of how the dialogue was launched.
    Furthermore, Its the very same code that launches the dialogue regardless of how it is launched. Why does the bar code scanner and the keyboard button completes without errors, but the form button does not. Is there something that these hardward devices does automatically that my form button is not?

    I'm not sure if I can explain this any better

  6. #6
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: "Object Is Not Defined" Error When I Use "Close Form" in the "OnInit"

    Quote Originally Posted by nigeldude View Post
    I tried the codes in the "onactivate", they weren't triggered.
    Whats most confusing is; its the very same set of codes that are in the dialogue's oninit regardless of how the dialogue was launched.
    Furthermore, Its the very same code that launches the dialogue regardless of how it is launched. Why does the bar code scanner and the keyboard button completes without errors, but the form button does not. Is there something that these hardward devices does automatically that my form button is not?
    I'm not sure if I can explain this any better
    You can't, not without code and context to look at. (ie Example). We get what you wish to accomplish, and the error.

Similar Threads

  1. Error "Extra characters at end of expression" when LINK field is type "K"
    By RichCPT in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 10-29-2011, 12:11 AM
  2. error - "a5.js" and "'this._keys.length' is null or not an object"
    By eritovs in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 10-13-2011, 09:12 PM
  3. form.view("fName","","","center","center")
    By reynolditpi in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 07-14-2008, 11:37 PM
  4. To "zoom to record" or to "open form" using action scripting, that is the question.
    By georgefurnel in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 06-18-2008, 06:32 PM
  5. "Add" and "Save" buttons don't stay on "Self" page
    By Scholin in forum Application Server Version 8
    Replies: 2
    Last Post: 02-05-2008, 07:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •