Normal Topic Using Natural links (Read 1009 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Using Natural links
Mar 30th, 2004 at 5:26pm
Print Post Print Post  
Is it true when using Natural links to link the parent and child together you MUST use the form with the subform to maintain the link?

Sunnyjena was having problems with her data. When she entered her inv data from the form with the natural linked inv subform  the data was visible when she searched the client at a later time.

When she had a data entry person enter data directly to the inv database even though they entered the Client number in the record it did not pull up when the client was searched from the form with the subform. (if a relational link was used with the client number as the key it would have worked as she had believed it would)

I believe my response to her should be that Sesame is functioning properly. It is just a mater of entering data incorrectly.

I was paranoid of giving out wrong info so I  suggested to her we should confirm this with the experts on the forum and widen this discussion to more then her and I.

So all please feel free to chime in.   

Thanks

If my understanding of natural links and data retention  is correct I can see the importance of being able to remove item choices from the command tree to protect against this type of error.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Using Natural links
Reply #1 - Mar 30th, 2004 at 5:36pm
Print Post Print Post  
Bob,

You are correct. A Parent record must be present to maintain Natual Links. Otherwise, orphaned records will be created. They will still be accessible from the standalone Subform, but will not appear under any particular Parent. In some cases, this is desirable behavior, inothers it is not.

We have it in the works to add an @Standalone() function to SBasic that can be used to prevent records from being added directly to Subforms.
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Using Natural links
Reply #2 - Mar 30th, 2004 at 6:16pm
Print Post Print Post  
Quote:
We have it in the works to add an @Standalone() function to SBasic that can be used to prevent records from being added directly to Subforms.


That sounds like a helpful command. Thanks

I am sure with a little thought and training there are many ways to protect against data errors.

Thanks for the new programming example Snippet on Preventing certain Users from adding new records. This gives us another tool already. Smiley
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
sunnyjenna
Member
*
Offline


No personal text

Posts: 11
Joined: Mar 21st, 2004
Re: Using Natural links
Reply #3 - Mar 30th, 2004 at 7:03pm
Print Post Print Post  
Thank you very much Bob for your help and clarification. Often times it helps to have others that can help to see the forest through the trees and point things out.

Can someone please post a clear example of what  I would attach to a button using the @formNewRecord(form) to add a new record to my sub form. Please be verbose.

I believe @formNewRecord(form) should allow me with a button press to add another sub form record to the parent client record.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Using Natural links
Reply #4 - Mar 30th, 2004 at 7:27pm
Print Post Print Post  
Quote:
Can someone please post a clear example of what  I would attach to a button using the @formNewRecord(form) to add a new record to my sub form. Please be verbose.


To follow the example in the Additions guide In the most basic form of use.

// Create a button element on the parent form that contains the subform. Place this
//  code on on element entry of button element.

var nn as int  //Create variable

nn = @formnewrecord("formname")  // enter your form name as it appears on the menu

// This will when clicked add a new record to subform. Be careful however because if the subform is on a tab (I believe yours is) even if the subform is not visible it will add a record.(it is easy to repeatedly click the button till you figure out your on the wrong tab)  If there is any on entry logic it is easy to create junk records.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Using Natural links
Reply #5 - Mar 30th, 2004 at 7:58pm
Print Post Print Post  
SunnyJenna,

I may have lied to you.Embarrassed Sorry

Do not use this the way I explained above. I might be wrong about using it in this basic manner. When clicked it does create the record but it seems to deactivate element logic in the subfield table until you exit your application.

Can anyone explain why this happens or the correct way to use @formNewRecord(form)
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Using Natural links
Reply #6 - Mar 30th, 2004 at 9:45pm
Print Post Print Post  
Found and fixed.

@FormNewRecord and NewRecord both have to turn off event programming while they are in operation (a very brief moment). @FormNewRecord found a way around turning event programming back on again.
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Using Natural links
Reply #7 - Mar 30th, 2004 at 11:26pm
Print Post Print Post  
Thanks for the speedy response.  Smiley
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged