Hot Topic (More than 10 Replies) Posting to a subform gives eradic behavior (Read 1870 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Posting to a subform gives eradic behavior
Mar 28th, 2004 at 2:15am
Print Post Print Post  
After many hours spent trying to post to a subform, I must suggest that there is a bug somewhere.

I am simply using a buttonon the parent form to copy data from an element on the parent form to an element on the subform.  USUALLY, the data copies to the subform, but it always puts it in the wrong elements!!!!! The programming is simple:

FormFieldValue("LineItems", "action", 1, action)
FormFieldValue("LineItems", "quality", 1, quality)
FormFieldValue("LineItems", "pattern", 1, pattern)

Just to be safe, I have deleted and re-created the LineItems database and all the elements use the same name for Label, Name, and "Bound to" field, just to save confusion. The names are all the same on the parent form, as well. ALso, all the fields are text fields on both parent and subform.

For what its worth, I also have a button that does the reverse and it works flawlessly!

Stock no = @formfieldvalue("lineitems", "stock no", 1)
quality = @formfieldvalue("lineitems", "quality", 1)
pattern = @formfieldvalue("lineitems", "pattern",1)

Please help before I throw my computer into the neighbors yard!

Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Posting to a subform gives eradic behavior
Reply #1 - Mar 28th, 2004 at 1:00pm
Print Post Print Post  
Before you start throwing things in your neighbor's yard - have you tried advancing the record you are writing to - to cause the record to commit?

FormResultSetCurrentPosition("LineItems", nn + 1)

When you say it puts the values in the wrong elements - is there a pattern? Is it off by one to the left or right? Is it in the wrong row?

Are you in Add mode or Update mode? Are you writing to a new record or an existing one?

I just tried the following in the Countries.db:

// On LE Exit for "Capital" on the Countries Form

FormFieldValue("Cities", "City", 1, "berlin")
FormFieldValue("Cities", "Population", "123")

and it seemed to work in both Add and Update modes. Could you give this a try and see if there is some reason why it might be acting differently in your application?

Also, what version of Sesame are you using?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Posting to a subform gives eradic behavior
Reply #2 - Mar 28th, 2004 at 3:03pm
Print Post Print Post  
Mark,

It appears that Sesame is simply posting to whatever LE it "Sees" first in the child database. It is not looking for the specified LE.

If you reverse the 'position" of the LEs in the Cities Database,  then "123 gets posted to the cities column, and "Berlin"  tries to get posted to the Population column, but a 0 is returned instead (becuase its a number field?)

I also added a couple LE's to the top of the cities db and it just made things worse.

Please confirm this on your end.

I'm using 1.0.2 ver. This bug is easy to reproduce for me. I tested in Add mode in Preview and in "actual" Sesame.

Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Posting to a subform gives eradic behavior
Reply #3 - Mar 28th, 2004 at 3:40pm
Print Post Print Post  
Okay, I see that. Looking into it now. It looks like the headers are getting out of synch.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Posting to a subform gives eradic behavior
Reply #4 - Mar 29th, 2004 at 2:36am
Print Post Print Post  
Thanks for looking into this. It also seems that the rules for importing into subforms have changed as well. I cant import into the parent and child records at one time.

This may all be related to the bug I reported. It looks like exporting is not going to work either (from the subform).

If there are changes to the way we are to import into subforrms, please add this to the manual addendum.

Thanks,
Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Posting to a subform gives eradic behavior
Reply #5 - Mar 29th, 2004 at 1:44pm
Print Post Print Post  
The rules for import and export have not changed. This may be related to the same issue. Can you describe what you are exporting, and what is wrong with the results?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Posting to a subform gives eradic behavior
Reply #6 - Mar 29th, 2004 at 2:09pm
Print Post Print Post  
Steve,

We just tried both an export and an import from an application that was showing your earlier bug, and had no troubles. Could you be more specific about what you are seeing?
  

- 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: Posting to a subform gives eradic behavior
Reply #7 - Mar 29th, 2004 at 6:15pm
Print Post Print Post  
I'm sorry, I was looking at the Mass update options, rather than the Import options.

However, when I click on a LE it highlights the correct name in the Spec Manager, making it easy to find when the list is very long, but clicking on a subform LE does not find or highlight the corresponding name in the Spec Manager. Maybe this is related to the earlier bug I mentioned.

Thanks for the help.

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Posting to a subform gives eradic behavior
Reply #8 - Apr 3rd, 2004 at 11:10pm
Print Post Print Post  
Mark, any luck fixing the subform header bug? Do you know of a workaround? Should I spend some time re-arranging the  layout of LE's on the subform so I can post to the proper feilds?

Thanks,

Steve in Texas
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Posting to a subform gives eradic behavior
Reply #9 - Apr 3rd, 2004 at 11:22pm
Print Post Print Post  
Yes. Sorry I didn't get anything up on the WorkArounds page. I'm afraid that tends to fall behind as we get near a release. The bug appears to be localized to the FormFieldValue call itself and has been fixed.

If you only have a few fields, you could rearrange them. Elsewise, you could try using FormFieldValue from the subform getting values from the main form.

We are likely to release an update soon - so keep that in mind before doing too much.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Posting to a subform gives eradic behavior
Reply #10 - Apr 3rd, 2004 at 11:33pm
Print Post Print Post  
YOU GUYS ROCK! VERY glad to hear 1.0.3 is coming out soon.

I'll just wait.

Thanks,
Steve in Texas
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Posting to a subform gives eradic behavior
Reply #11 - Apr 4th, 2004 at 3:13pm
Print Post Print Post  
Mark,

Too much of my programming depends on getting this thing to work, so Im going to try your workaround, but have a question.

What programming would I use while in the subform, to get LE data from the parent form? Something like this?

in On Form Entry in Subform

stock no = (invoice!stock no)  ?


ps. is it ok for a subform and a parent form to have the same "LE Name" ?

Thanks,
Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Posting to a subform gives eradic behavior
Reply #12 - Apr 4th, 2004 at 3:44pm
Print Post Print Post  
No, you would need to use @FormFieldValue and its ilk. There may be other, better workarounds. Have you tried creating a new .dsr from .db, then saving the .dsr as a new .db (use backups) to try to force the headers back in synch? You may try deleting the subform off of the parent form (do not delete the subform itself) and putting it back on the subform, again to try to force synch. Remember to use a backup copy of the files.

Also, I suspect that we are only days away from an update. So you may want to wait.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Posting to a subform gives eradic behavior
Reply #13 - Apr 4th, 2004 at 3:46pm
Print Post Print Post  
Quote:
ps. is it ok for a subform and a parent form to have the same "LE Name" ?


It may be allowed, but I wouldn't recommend it.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Posting to a subform gives eradic behavior
Reply #14 - Apr 4th, 2004 at 10:59pm
Print Post Print Post  
Thanks for the suggestions. Still no luck after playing around a bit. I guess I'll just have to wait. Sad

by the way,

I had been using LE names with spaces, such as "Import from File" and had 0 problems (testing found no errors, and everything worked fine), then for no apparent reason, testing found problems with the names, and I had to rename the LEs to names without spaces for the problem to go away.

Weird. If this becomes more common, you may want to disallow the use of spaces in LE names.

Just FYI.
Steve
  
Back to top
IP Logged