Alpha Video Training
Results 1 to 22 of 22

Thread: parentform.commit() weird problem

  1. #1
    Member
    Real Name
    Arlen Troup
    Join Date
    Feb 2003
    Posts
    145

    Default parentform.commit() weird problem

    I have used Alpha 5 for many years and have successfully created many forms to enter data. Now I have a problem that I have never encountered before. I am working on a very simple database to create mailing lists. The primary table contains only names and addresses. I have a form to enter names and addresses. Should be simple! One of the buttons on the form is to enter data and then enter a new record. The code attached to the button is simply: parentform:commit(), parentform.close(), form.view [same form to enter another record]. However I have to click the button three times before commit occurs. I am unable to find anything wrong with the form or table so I deleted the form and created a new one. Same problem with the new form. I can't figure out what is happening. The many similar forms I have created in other databases require only clicking the button once to commit the record. Any suggestions would be greatly appreciated as this is driving me crazy!

  2. #2
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: parentform.commit() weird problem

    can you not use topparent.commit() topparent.new_record() and see if it works better instead of closing and opening the form?
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  3. #3
    Member
    Real Name
    Arlen Troup
    Join Date
    Feb 2003
    Posts
    145

    Default Re: parentform.commit() weird problem

    Just to clarify: It does not matter what code comes after the .commit(). It takes one click to get there and three clicks for the .commit() to execute!

  4. #4
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    We'll need a sample table uploaded to this thread to recreate the problem.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  5. #5
    Member
    Real Name
    Arlen Troup
    Join Date
    Feb 2003
    Posts
    145

    Default Re: parentform.commit() weird problem

    Per request a portion of the primary table is attached.

    (I removed your attachment since it contained names and addresses.)
    Last edited by Al Buchholz; 01-31-2017 at 10:53 AM.

  6. #6
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Quote Originally Posted by Arlen View Post
    Per request a portion of the primary table is attached.
    Thanks for posting a sample.

    I didn't notice that you have not mentioned the version of Alpha that you are using.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  7. #7
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Quote Originally Posted by Al Buchholz View Post
    Thanks for posting a sample.

    I didn't notice that you have not mentioned the version of Alpha that you are using.

    Also, sending just the dbf is not enough. We need the support files that go with it so we can see everything that is going on.

    ie a form and the tables field rules...
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  8. #8
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Arlen

    Please zip the table from the control panel and attach to this thread.

    If you have too much data, then duplicate the table and objects, then delete most of the data, pack, and then zip the new table.

    We really need to see what you are doing.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  9. #9
    Member
    Real Name
    Arlen Troup
    Join Date
    Feb 2003
    Posts
    145

    Default Re: parentform.commit() weird problem

    Using version 10

  10. #10
    Member
    Real Name
    Arlen Troup
    Join Date
    Feb 2003
    Posts
    145

    Default Re: parentform.commit() weird problem

    entire database attaches (partial dbf table) . Access DBA vai "admin" password
    Attached Files Attached Files

  11. #11
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Please provide a quick step by step of what to do.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  12. #12
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Quote Originally Posted by Arlen View Post
    The code attached to the button is simply: parentform:commit(), parentform.close(), form.view [same form to enter another record]. However I have to click the button three times before commit occurs.
    What if you replace the close and reopen of the form found on the 'Add Another Address' button with this: (this uses your onactivate code insteadof doing all of the work of closeing and re-opening the same form. Which I'm assuming is to call your onactivate event.??)

    Code:
    topparent.Commit()
    'parentform.Close()
    '
    'form.view("mail_info")
    parentform.New_Record()
    parentform:record_entered.value=date() ' since this field is hidden on the form, you could also accomplish this with a field rule default value.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  13. #13
    Member
    Real Name
    Arlen Troup
    Join Date
    Feb 2003
    Posts
    145

    Default Re: parentform.commit() weird problem

    Instructions for Al: on main menu select "Enter Address". Fill all fields. Then select either "Save and Exit" or "Add Another Address". When I do this on my desktop pc using the full software I must click three time to execute the code. On my laptop with only the runtime engine the results are identical. I haven't tried it recently but I think if only some of the fields are filled the code executes with only one click. (Probably a clue but I couldn't determine the cause). Once in a while it worked with just two clicks.

  14. #14
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Arlen

    Has this been resolved by changing the code as described?

    Wondering minds are interested. Especially before the weekend hits and all is forgotten...
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  15. #15
    Member
    Real Name
    Arlen Troup
    Join Date
    Feb 2003
    Posts
    145

    Default Re: parentform.commit() weird problem

    Per a previous post changing code after .commit() or no code after .commit() requires three clicks to execute .commit()

  16. #16
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Quote Originally Posted by Al Buchholz View Post
    What if you replace the close and reopen of the form found on the 'Add Another Address' button with this: (this uses your onactivate code insteadof doing all of the work of closeing and re-opening the same form. Which I'm assuming is to call your onactivate event.??)

    Code:
    topparent.Commit()
    'parentform.Close()
    '
    'form.view("mail_info")
    parentform.New_Record()
    parentform:record_entered.value=date() ' since this field is hidden on the form, you could also accomplish this with a field rule default value.
    Interesting this works for me. So what build of Alpha are you using and what operating system do you have?
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  17. #17
    Member
    Real Name
    Arlen Troup
    Join Date
    Feb 2003
    Posts
    145

    Default Re: parentform.commit() weird problem

    Tried your suggested code but my problem remains!

    My OS is Windows 10. Alpha Five is build 3359. There was a later build but when I installed it some code would not work so I went back to the previous build. It has been some time ago so I don't remember what the problem was. Until now I have never had any problems. I am using Alpha Five 10 in compatability mode.

  18. #18
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Quote Originally Posted by Arlen View Post
    Tried your suggested code but my problem remains!

    My OS is Windows 10. Alpha Five is build 3359. There was a later build but when I installed it some code would not work so I went back to the previous build. It has been some time ago so I don't remember what the problem was. Until now I have never had any problems. I am using Alpha Five 10 in compatability mode.
    I run 4369 - 3712 on windows 7 compatibility on windows 10 and the code runs fine. That has been a very stable release.

    You may want to review the other code that gave you problems and fix it.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  19. #19
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,642

    Default Re: parentform.commit() weird problem

    My OS is Win10 and I opened the file in v11 without any incident or need to double click. Also after saving the new record, a simple topparent.new_record() worked fine without having to close and reopen the form.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  20. #20
    Member
    Real Name
    Jeff Carroza
    Join Date
    Nov 2006
    Location
    Huntington NY
    Posts
    45

    Default Re: parentform.commit() weird problem

    I was having a similar problem. I have a form with an embedded browse, on the form are buttons to enter records into the child table. I was using "commit()" to save the record. I would have to click on the button twice for the new record to be saved. I changed "commit()" to "enter_end()". The buttons now work with one click.

    Jeff C

  21. #21
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,583

    Default Re: parentform.commit() weird problem

    Quote Originally Posted by Jeff Carroza View Post
    I was having a similar problem. I have a form with an embedded browse, on the form are buttons to enter records into the child table. I was using "commit()" to save the record. I would have to click on the button twice for the new record to be saved. I changed "commit()" to "enter_end()". The buttons now work with one click.

    Jeff C
    Jeff

    Can you show a little more of your code and where it is located?
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  22. #22
    Member
    Real Name
    Jeff Carroza
    Join Date
    Nov 2006
    Location
    Huntington NY
    Posts
    45

    Default Re: parentform.commit() weird problem

    Each button has its own data for the field "action". Here is the code for one of the buttons:

    browse1.activate()
    :payments:tables:custrec.enter_begin(Honor_Field_Rules)
    :payments:tables:custrec.action = "17 PROPOSAL RET"
    :payments:tables:custrec.date = date()
    :payments:tables:custrec.enter_end()
    Parentform.resynch()

    When the button is pushed the script enters into the child table; "17 PROPOSAL RET" in the field "action" and the system date into the field date. The record is then saved. When I was using "commit()" instead of "enter_end" the button would enter the text and date but it wouldn't save. If I closed the form after pushing the button I would get a prompt do I want to save entry in progress. If I clicked on the button twice it would save the record.

    Jeff C

Similar Threads

  1. Weird problem
    By samius in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 02-19-2013, 02:55 PM
  2. problem with parentform.name?
    By dvenus in forum Alpha Five Version 8
    Replies: 4
    Last Post: 05-26-2007, 05:16 PM
  3. Weird problem
    By Robin Smith in forum Alpha Five Version 5
    Replies: 7
    Last Post: 05-19-2004, 12:22 PM
  4. parentform.close() problem
    By Mike Sabo in forum Alpha Five Version 5
    Replies: 4
    Last Post: 11-18-2003, 09:01 AM
  5. WEIRD PROBLEM
    By Jeff, Richards in forum Alpha Five Versions 2 and 3
    Replies: 1
    Last Post: 06-29-2001, 04:02 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
  •