Normal Topic @IsNew not working with Import (Read 609 times)
nateboone
Junior Member
**
Offline



Posts: 54
Joined: Dec 19th, 2006
@IsNew not working with Import
Feb 23rd, 2008 at 8:51pm
Print Post Print Post  
Hi--

I'm importing new files into my database from a website and would like to use @IsNew programming (not @Add) as I initially go through and modify them, but it seems that after I import, those files are not considered new (even though it's the first time I've actually seen them).  Any suggestions?

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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: @IsNew not working with Import
Reply #1 - Feb 23rd, 2008 at 9:08pm
Print Post Print Post  
@IsNew means, to Sesame, that the record has not yet been written to disk. If you are navigating throught the result set, then the records have already been written to disk. You may need to use @Add instead.
  


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



Posts: 104
Joined: Sep 3rd, 2007
Re: @IsNew not working with Import
Reply #2 - Feb 23rd, 2008 at 9:09pm
Print Post Print Post  
@IsNew is working fine, as a record is only in the "New" state if it has yet to be saved to the database.  Once it is imported, it has been saved, and thus is no longer "New".  I suggest adding a Boolean field that you can use to indicate if the record has had its first edit.  Then, you can check the state of the field in the On Form Load event in order to execute your logic, making sure to also change the state so that your logic only runs once.
  
Back to top
 
IP Logged
 
nateboone
Junior Member
**
Offline



Posts: 54
Joined: Dec 19th, 2006
Re: @IsNew not working with Import
Reply #3 - Feb 23rd, 2008 at 9:39pm
Print Post Print Post  
What command do I use to "indicate if the record has had its first edit"?

@Add will not work for other reasons that are too complicated to explain at this point...
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: @IsNew not working with Import
Reply #4 - Feb 24th, 2008 at 12:18am
Print Post Print Post  
Add other elements to the form used for the import: DataSource, ImportDate, ImportTime, and make the default value of the Source element = "Data Entry".  Make the elements Visible if DataSource <> "Data Entry".  This will make them visible only for imported records.

Now, import your records and retrieve records where the DataSource element is blank.

Now do a Mass Udate on the imported records to fill in the name of the data source in DataSource, and the date and time imported into the other two elements.  Now you can select all records associated with a particular import process and do additional processing as needed.

You could do some things with visibility on these extra elements, for instance only make them visible on the Retrieve Spec screen.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged