Normal Topic table subform won't retain data. (Read 914 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
table subform won't retain data.
Nov 19th, 2007 at 11:12pm
Print Post Print Post  
In a table-mode subform, a NEWLY CREATED record will not retain data posted to it via formfieldvalue command. Only if I completely save the record (F-10), close the form, reopen the form, will the below program actually post the data to the field:

var x as int = 1
formfieldvalue("order", "status", x, "In-Progress")

in the above program, the status field will not be set to 'In-Progress'.
I've put formcommit("order") in multiple places, but it doesn't seem to help.
Sesame does report that the subrecord does exist as '1'

Is this a known bug?



  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: table subform won't retain data.
Reply #1 - Nov 19th, 2007 at 11:27pm
Print Post Print Post  
Steve,

You can fix this with a FormCommit("ParentFormName") just after the FormFieldValue() command.

Try something like this:
Var x as Int = 1
FormFieldValue("order", "status", x, "In-Progress")
FormCommit("ParentFormName")


(If you are using FormFieldValue() in a loop, put the FormCommit() after the loop, not inside it.)
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: table subform won't retain data.
Reply #2 - Nov 19th, 2007 at 11:41pm
Print Post Print Post  
Thanks Carl, I'm trying that now.

Do I need the formcommit command after each formfieldvalue command in a program, or just after the last command?
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: table subform won't retain data.
Reply #3 - Nov 19th, 2007 at 11:58pm
Print Post Print Post  
[quote author=Steve_in_Texas link=1195513968/0#2 date=1195515709]Thanks Carl, I'm trying that now.

Do I need the formcommit command after each formfieldvalue command in a program, or just after the last command?[/quote]

For best results:
Do all your FormFieldValue commands for the subrecord.
FormCommit the subrecord.
FormCommit the Parent.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: table subform won't retain data.
Reply #4 - Nov 20th, 2007 at 12:48am
Print Post Print Post  
Sill no luck for me. Looks like the data is posting correctly, but then losing the data when the formcommit command is run. I also found that running asynchshell command just after formfieldvalue command causes a subrecord to be completely deleted (removing the formfieldvalue command fixed this.)

We're going to revert back to 1.0.5 until we have more time to sort out these issues. (And I have a 'pen failure' issue as well as some other problems that may require Ray's help.)

Thanks for your time. I'll be in touch.
Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: table subform won't retain data.
Reply #5 - Nov 20th, 2007 at 1:03am
Print Post Print Post  
Please do get in touch with Support, Steve. We're successfully using FormFieldValue and creating subrecords in code all over the place. Something must be interfering in your case.

Perhaps you have your parent form or subform set to prevent save with NotifyForm? Or your subs are relational and you are not setting the correct relational key? It's got to be something along those lines. Support may be able to help you track down the problem.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: table subform won't retain data.
Reply #6 - Nov 20th, 2007 at 4:24pm
Print Post Print Post  
Hello Steve,

When you get a second send in your application along with steps on how to see this and I'll take a look at it and see what is causing this problem in your app.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: table subform won't retain data.
Reply #7 - Nov 20th, 2007 at 4:30pm
Print Post Print Post  
Thanks Ray. We're back up and running on 1.1.5a so now I have more time to troubleshoot our issues in 2.0. I'll get in touch with you after I take a good hard look at things.

Thanks again.
Steve
  
Back to top
IP Logged