Jason Hect | 16 May 20:05

Load Record Error - V11

This will work OK in 4D 2004, but the Load Record command causes an 
error in V11.  It's actually just the last 2 lines that cause the 
problem, I'm just creating a record so I can delete it. :)

CREATE RECORD([Test_Data])
SAVE RECORD([Test_Data])
DELETE RECORD([Test_Data])
LOAD RECORD([Test_Data])

Where I run into this problem is when changing read write access to a 
table.  I have a method to control this, which unloads any records, 
changes read write access, and then reloads the record.  In my code I do 
something like this:

Query([Test_Data];[Test_Data]ID=123)`Find a record
D_Access(True;->[Test_Data]) `Call method to get read write access to table
DELETE RECORD([Test_Data])
D_Access(False;->[Test_Data]) `Call method to set read only access to 
table, which will unload record, change access, and reload causing error.

I guess I need to experiment some more, but do I no longer need to 
unload the current record in V11 before changing table read write access?

Thanks,
Jason

**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

(Continue reading)

Jason Hect | 16 May 20:16

Re: Load Record Error - V11


OK, now that I start really playing with it, I can't seem to put a table in
READ ONLY mode?  No matter what I do, I can always delete a record???

Thanks,
Jason

--

-- 
View this message in context: http://www.nabble.com/Load-Record-Error---V11-tp17280873p17281099.html
Sent from the 4D Tech mailing list archive at Nabble.com.

**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************

Chuck Miller | 16 May 20:17

Re: Load Record Error - V11

Once you delete a record, there is nothing to load. This has always  
been true

Regards

Chuck
On May 16, 2008, at 2:08 PM, Jason Hect wrote:
> This will work OK in 4D 2004, but the Load Record command causes an  
> error in V11.  It's actually just the last 2 lines that cause the  
> problem, I'm just creating a record so I can delete it. :)
>
> CREATE RECORD([Test_Data])
> SAVE RECORD([Test_Data])
> DELETE RECORD([Test_Data])
> LOAD RECORD([Test_Data])
>
>
> Where I run into this problem is when changing read write access to  
> a table.  I have a method to control this, which unloads any  
> records, changes read write access, and then reloads the record.   
> In my code I do something like this:
>
> Query([Test_Data];[Test_Data]ID=123)`Find a record
> D_Access(True;->[Test_Data]) `Call method to get read write access  
> to table
> DELETE RECORD([Test_Data])
> D_Access(False;->[Test_Data]) `Call method to set read only access  
> to table, which will unload record, change access, and reload  
> causing error.
>
(Continue reading)

Jason Hect | 16 May 20:37

Re: Load Record Error - V11


It's just that in 2004 and previous I didn't have to worry about it.

So do I need to always check to make sure there is a record in the current
selection before calling load record?  (I guess so)

Chuck Miller-2 wrote:
> 
> Once you delete a record, there is nothing to load. This has always  
> been true
> 
> Regards
> 
> 
> Chuck
> On May 16, 2008, at 2:08 PM, Jason Hect wrote:
>> This will work OK in 4D 2004, but the Load Record command causes an  
>> error in V11.  It's actually just the last 2 lines that cause the  
>> problem, I'm just creating a record so I can delete it. :)
>>
>> CREATE RECORD([Test_Data])
>> SAVE RECORD([Test_Data])
>> DELETE RECORD([Test_Data])
>> LOAD RECORD([Test_Data])
>>
>>
>> Where I run into this problem is when changing read write access to  
>> a table.  I have a method to control this, which unloads any  
>> records, changes read write access, and then reloads the record.   
>> In my code I do something like this:
(Continue reading)

Paul Mohammadi | 16 May 21:29

Re: Load Record Error - V11

Jason

I "think", In 4D, the current record pointer points to the last loaded
record. So if this record is deleted, the pointer is pointing to ?

Therefore in your example, I would prefer for LOAD RECORD to return an
error.  I know this looks like it is more work for the developer (it
is) but this is always the way it should have worked from day 1... in
your example, the reloading is done through the same method as the one
that deletes it.. this is a big issue when confronted in a
multi-process multi-user system. Thankfully we're more industry
compliant with this behavior.  I welcome this change in behavior with
open arms.

I added a DELAY PROCESS command to your code.  Imagine if 4D decided
to write a new record in the same space that was just vacated by your
DELETE RECORD before the delay.  Are you still going to trust LOAD
RECORD after that?

CREATE RECORD([Test_Data])
SAVE RECORD([Test_Data])
DELETE RECORD([Test_Data])
DELAY PROCESS(Current Process; 300)
LOAD RECORD([Test_Data])

Best

Paul

On Fri, May 16, 2008 at 2:37 PM, Jason Hect <jhect@...> wrote:
(Continue reading)

Re: Load Record Error - V11

A new error code was added in 4D v11 SQL for operations that involve
deleted records, like using a set with delete records, etc.

It sounds like it also occurs for LOAD RECORD.

Are you getting error -10503?

If you want to ignore the error, use ON ERR CALL to do so.

Kind regards,

Josh Fletcher

Jason Hect wrote:
> This will work OK in 4D 2004, but the Load Record command causes an 
> error in V11.  It's actually just the last 2 lines that cause the 
> problem, I'm just creating a record so I can delete it. :)
> 
> CREATE RECORD([Test_Data])
> SAVE RECORD([Test_Data])
> DELETE RECORD([Test_Data])
> LOAD RECORD([Test_Data])
> 
> 
> Where I run into this problem is when changing read write access to a 
> table.  I have a method to control this, which unloads any records, 
> changes read write access, and then reloads the record.  In my code I do 
> something like this:
> 
> Query([Test_Data];[Test_Data]ID=123)`Find a record
(Continue reading)

Jason Hect | 16 May 20:35

Re: Load Record Error - V11


Actually I get, "The record cannot be read.  Record # is out of range."

Josh Fletcher (4D, Inc.) wrote:
> 
> A new error code was added in 4D v11 SQL for operations that involve
> deleted records, like using a set with delete records, etc.
> 
> It sounds like it also occurs for LOAD RECORD.
> 
> Are you getting error -10503?
> 
> If you want to ignore the error, use ON ERR CALL to do so.
> 
> Kind regards,
> 
> Josh Fletcher
> 
> Jason Hect wrote:
>> This will work OK in 4D 2004, but the Load Record command causes an 
>> error in V11.  It's actually just the last 2 lines that cause the 
>> problem, I'm just creating a record so I can delete it. :)
>> 
>> CREATE RECORD([Test_Data])
>> SAVE RECORD([Test_Data])
>> DELETE RECORD([Test_Data])
>> LOAD RECORD([Test_Data])
>> 
>> 
>> Where I run into this problem is when changing read write access to a 
(Continue reading)

Chuck Miller | 16 May 21:45

Re: Load Record Error - V11

That is because that there is NO current record

Regards

Chuck
On May 16, 2008, at 2:35 PM, Jason Hect wrote:
>
> Actually I get, "The record cannot be read.  Record # is out of  
> range."
>

------------------------------------------------------------------------ 
---
Chuck Miller                          Voice: (617) 739-0306
Informed Solutions, Inc.              Fax: (617) 232-1064
------------------------------------------------------------------------ 
----

**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************

(Continue reading)

Jack des Bouillons | 17 May 00:05

4D Live Window & Pre-Populating a Web Form


I have need to do the following:

I need to load a web form (from a site over which I have NO CONTROL) from
within my 4D system, and populate some of the forms variables with data from
my 4D system.  Then, when the user completes the forms and submits it, I
need to capture all the data entry back into my system.

>From what I had heard of 4D LiveWindow 1.2, I thought I could use it to
accomplish this.  But, in reading the documentation and looking at the
examples, I don't see quite how I can do this.

Any suggestions of how I can use 4D LiveWindow to do this, or any other
suggestions, will be greatly appreciated (and may result in the receipt of a
glass of VERY fine red wine at the upcoming Summit in Long Beach!)

Jack des Bouillons

**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************

(Continue reading)

Re: 4D Live Window & Pre-Populating a Web Form

Hi Jack,

Check out the JavaScript Injection Tech Note for one idea of how this
could be accomplished.

For both pre-filling and capturing the data you can use the callback
feature to detect what's going on with the page (page load, page submitted).

Then you could inject JavaScript into the page to both fill the values
and to get them back.

Here's the Tech Note:

http://www.4dpartnercentral.com/4DACTION/Web_Solutions/Show.PublicCase?tCaseID=47487

(Note that you need to log into Partner Central to actually download it,
if you click the link on the page above it will not work).

Kind regards,

Josh Fletcher

Jack des Bouillons wrote:
> I have need to do the following:
> 
> I need to load a web form (from a site over which I have NO CONTROL) from
> within my 4D system, and populate some of the forms variables with data from
> my 4D system.  Then, when the user completes the forms and submits it, I
> need to capture all the data entry back into my system.
> 
(Continue reading)

Jack des Bouillons | 17 May 02:29

Re: 4D Live Window & Pre-Populating a Web Form

In the tech note, there is this limitation:

"Currently the execution of JavaScript is only supported on Windows.  The
browser layer on Mac OS (Webkit) is simply too unstable when
programmatically executing JavaScript and these instabilities can cause the
4D database to crash. As such the demo database will not function correctly
on Mac OS. "

This is a Mac-only shop...so if this limitation still exists, it isnot a
solution here I'm afraid.

Thanks anyway.

Jack des Bouillons

On 5/16/08 3:16 PM, "Josh Fletcher (4D, Inc.)" <jfletcher@...> wrote:

> Hi Jack,
> 
> Check out the JavaScript Injection Tech Note for one idea of how this
> could be accomplished.
> 
> For both pre-filling and capturing the data you can use the callback
> feature to detect what's going on with the page (page load, page submitted).
> 
> Then you could inject JavaScript into the page to both fill the values
> and to get them back.
> 
> Here's the Tech Note:
> 
(Continue reading)

Re: 4D Live Window & Pre-Populating a Web Form

Bummer :(

Yes, this limitation still exists on Mac OS X with 4D Live Window.  It
works great on Windows, but can be unstable on Mac OS X.

It was worth a shot :)

Kind regards,

Josh Fletcher

Jack des Bouillons wrote:
> In the tech note, there is this limitation:
> 
> "Currently the execution of JavaScript is only supported on Windows.  The
> browser layer on Mac OS (Webkit) is simply too unstable when
> programmatically executing JavaScript and these instabilities can cause the
> 4D database to crash. As such the demo database will not function correctly
> on Mac OS. "
> 
> 
> This is a Mac-only shop...so if this limitation still exists, it isnot a
> solution here I'm afraid.
> 
> Thanks anyway.
> 
> Jack des Bouillons

--

-- 
Josh Fletcher
(Continue reading)

Lee Hinde | 17 May 08:24

Re: 4D Live Window & Pre-Populating a Web Form

On Fri, May 16, 2008 at 3:05 PM, Jack des Bouillons
<jack.desbouillons@...> wrote:
>
> I have need to do the following:
>
> I need to load a web form (from a site over which I have NO CONTROL) from
> within my 4D system, and populate some of the forms variables with data from
> my 4D system.  Then, when the user completes the forms and submits it, I
> need to capture all the data entry back into my system.
>
> >From what I had heard of 4D LiveWindow 1.2, I thought I could use it to
> accomplish this.  But, in reading the documentation and looking at the
> examples, I don't see quite how I can do this.
>
> Any suggestions of how I can use 4D LiveWindow to do this, or any other
> suggestions, will be greatly appreciated (and may result in the receipt of a
> glass of VERY fine red wine at the upcoming Summit in Long Beach!)
>
> Jack des Bouillons
>

Can you put yourself in the middle and act as a proxy  to the external
web server?
**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
(Continue reading)

Jack des Bouillons | 19 May 17:23

Re: 4D Live Window & Pre-Populating a Web Form

Hope...

Not in this case...

Jack 

On 5/16/08 11:24 PM, "Lee Hinde" <leearchive@...> wrote:

> Can you put yourself in the middle and act as a proxy  to the external
> web server?

**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************

Jack des Bouillons | 19 May 17:31

Re: 4D Live Window & Pre-Populating a Web Form

Sorry..

That was supposed to be NOPE...not in this case...

Jack

On 5/19/08 8:23 AM, "Jack des Bouillons" <jack.desbouillons@...>
wrote:

> 
> Hope...
> 
> Not in this case...
> 
> Jack 

**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************

Alexander Heintz | 17 May 22:52

Re: 4D Live Window & Pre-Populating a Web Form

Hi Jack,

rewrite the page!
Load it, grab it off LiveWindow, modify it and put it back into live  
window, only then let LiveWindow redraw, or unhide or whatever.
Check for the field you need to populate and insert VALUE strings,  
next overwrite the form ACTION redirecting it to your own 4D based Web  
server thus capturing the resulting data.
I use a similar technique to rewrite pages with links to work offline  
with media i downloaded into a specific location.
Thanks to the nature of HTML Pages it is rather easy to acomplish this  
task using either brute force string insert/replace aproach or (more  
elgantly) using Regular Expressions, though please do not ask me for  
the expression :-)

HTH

Alex

>
> I have need to do the following:
>
> I need to load a web form (from a site over which I have NO CONTROL)  
> from
> within my 4D system, and populate some of the forms variables with  
> data from
> my 4D system.  Then, when the user completes the forms and submits  
> it, I
> need to capture all the data entry back into my system.
>
(Continue reading)

Balinder Walia | 18 May 09:49

Re: 4D Live Window & Pre-Populating a Web Form

Jack,
You should be able to achieve this fairly easily. Grab all html from 4D live
window as Alex mentioned. Then insert just the javascript function or
external ref to javascript file in between <head> and </head> tags. And then
set the html back to 4D live window.

Examples:

Say your html looks like this before injecting your JavaScript function:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML From 4D Live Window</title>
<meta name="generator" content="BBEdit 8.7" />
</head>
<body>
__

And after inserting your JavaScript code it may look like:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML From 4D Live Window</title>
<meta name="generator" content="BBEdit 8.7" />
 <script type="text/javascript" src="myFormAutoLoader.js">

(Continue reading)

Re: Load Record Error - V11

Jason,

Jason Hect wrote:
> Actually I get, "The record cannot be read.  Record # is out of range."

That's the error message.  If you click the "Details" button you will
see that the error code is -10503.

Similarly, if you check the ERROR system variable with ON ERR CALL you
will see that the error code is the same.

So, yes, this was intentionally changed in 4D v11 SQL.

Kind regards,

Josh Fletcher

--

-- 
Josh Fletcher
Technical Services Team Member
4D, Inc.
**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
(Continue reading)

Jason Hect | 16 May 22:06

Re: Load Record Error - V11


I guess this all makes sense, and it's just that prior to V11 4D was more
liberal about allowing this.

To back up a step then, how should the logic work for my D_Access method? 
I've been using it "forever", and now it doesn't work in V11. :(

Basically a simplified version looks like this:

`---------------------------------------------
C_BOOLEAN($1)
C_POINTER($2)

If($1)
  UNLOAD RECORD($2->)
  READ WRITE($2->)
  LOAD RECORD($2->)
Else
  UNLOAD RECORD($->)
  READ ONLY($->) 
  LOAD RECORD($->)
End If
`--------------------------------------------

I rely on the method to change the read write state of the current record,
so I have to unload and reload to change state. (right?)  Even if I were to
check with RECRORDS IN SELECTION before calling LOAD RECORD, it would return
1 after a DELETE RECORD unless I call UNLOAD RECORD before I delete it.

For Example:
(Continue reading)

Paul Mohammadi | 17 May 00:18

Re: Load Record Error - V11

Jason

First Make your method in to a function

C_BOOLEAN($0)  ` True = No issues
C_BOOLEAN($1)
C_POINTER($2)   ` Pointer to the table
C_BOOLAEN($ReadOnly)

$0:=False
If ($1)
  $ReadOnly:=Read Only State($2->)
  If ($ReadOnly)
     READ WRITE($2->)
     LOAD RECORD($2->)
  End If

  If (Locked($2->)=False)
    DELETE RECORD($2->)
    $0:=True
   ` Optionally if you want
  REDUCE SELECTION([Test_Data];0)
  End if

  If ($ReadOnly)
     READ ONLY ($2->)
  End if

End if

(Continue reading)

Paul Mohammadi | 17 May 00:22

Re: Load Record Error - V11

Jason,

I used the Locked function in my method because of simplicity's sake..
you should really create a Wrapper using LOCKED ATTRIBUTE because LA
is also able to tell you if the Record you're trying to take action on
is already Deleted.  It's pretty useful.

Best

Paul

On Fri, May 16, 2008 at 6:18 PM, Paul Mohammadi <paul.m.33@...> wrote:
> Jason
>
> First Make your method in to a function
>
> C_BOOLEAN($0)  ` True = No issues
> C_BOOLEAN($1)
> C_POINTER($2)   ` Pointer to the table
> C_BOOLAEN($ReadOnly)
>
> $0:=False
> If ($1)
>  $ReadOnly:=Read Only State($2->)
>  If ($ReadOnly)
>     READ WRITE($2->)
>     LOAD RECORD($2->)
>  End If
>
>  If (Locked($2->)=False)
(Continue reading)

Chip Scheide | 16 May 22:32

Re: Load Record Error - V11 - different idea

Code :

  `(m) utl_Read_Only
  `$1 - pointer - pointer to table to place into read only
  `leave selection as it started - but unsorted
  `∙Created 4-22-05 by Chip
C_POINTER($1;$Table)

$Table:=$1
CREATE SET($Table->;"Read_Only_Temp")  `save current record selection

REDUCE SELECTION($Table->;0)  `remove all records from current 
selection, so none are loaded
READ ONLY($Table->)  `make table read only
USE SET("Read_Only_Temp")  `replace selection
CLEAR SET("Read_Only_Temp")  `clean up
  `

**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************

(Continue reading)

Jason Hect | 19 May 20:57

Re: Load Record Error - V11


Can someone confirm this behavior, or tell me the err in my ways?

`Everything done in Read Only
READ ONLY([Test_Data])

`Create a Test record
CREATE RECORD([Test_Data])
[Test_Data]Name:="test0"
SAVE RECORD([Test_Data])
REDUCE SELECTION([Test_Data];0)

`Find Test record and try to modify while still in Read Only
QUERY([Test_Data];[Test_Data]Name="test@")
[Test_Data]Name:="test1"
SAVE RECORD([Test_Data])
REDUCE SELECTION([Test_Data];0)

`The Read only worked (as expected), the change wasn't saved
QUERY([Test_Data];[Test_Data]Name="test@")

`Try to delete the record.  Shouldn't be able to since in Read Only
DELETE RECORD([Test_Data])
QUERY([Test_Data];[Test_Data]Name="test@")
`The record is deleted!?!?

V11.1 on Windows Vista.

Thanks!
Jason
(Continue reading)

Paul Mohammadi | 19 May 23:17

Re: Load Record Error - V11

you can only delete records that are not "locked", a record loaded in
READ ONLY is considered "locked" to the current process.

There are two situations you want to consider.

Table status must be set to READ WRITE prior to deleting a selection
of records otherwise it's like you allow the database to delete Locked
records in batches.

Table status must be set to READ WRITE prior to loading a record
otherwise you allow the database to delete a Locked Record.
**********************************************************************
The 4D v11 SQL Roadshow - coming to a city near you!
http://www.4D.com/roadshow/index.html

4th Dimension Internet Users Group (4D iNUG)
FAQ:  http://www.4d.com/support/faqnug.html
Archive:  http://dir.gmane.org/gmane.comp.lang.inug-4d.tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
Post: mailto:4d_tech@...
Options: https://lists.4d.com/mailman/listinfo/4d_tech
**********************************************************************

Jason Hect | 19 May 23:51

Re: Load Record Error - V11


I'm not understanding this?

The table is in Read Only, with no records in current selection.
I load a record and as you mention below, the record should be locked to the
current process.
I can confirm this by calling Read Only State, which will equal True.
If I try to modify and save the record, the changes are not saved (as I
would expect, its locked!)
But then, I can turn around delete the record!?!  How is that possible?

I ran the same code in 2004, and the record is not deleted.  Am I totally
missing something here, or is it a bug?

Thanks!
Jason

Paul Mohammadi wrote:
> 
> you can only delete records that are not "locked", a record loaded in
> READ ONLY is considered "locked" to the current process.
> 
> There are two situations you want to consider.
> 
> Table status must be set to READ WRITE prior to deleting a selection
> of records otherwise it's like you allow the database to delete Locked
> records in batches.
> 
> Table status must be set to READ WRITE prior to loading a record
> otherwise you allow the database to delete a Locked Record.
(Continue reading)

Paul Mohammadi | 19 May 23:53

Re: Load Record Error - V11

Sorry Jason I did not answer your concern properly....
When you create a new Record, that record is not added to the current
selection...
I suspect there is an issue here with REDUCE SELECTION and the newly
created record.

I agree with you, following th elogic of your code, it looks like
there is an issue but when you do a QUERY, the current record in
memory is already loaded so you don't get a reload from the Server.

So to remedy your problem you need to do either

READ ONLY([Test_Data])

`Create a Test record
CREATE RECORD([Test_Data])
[Test_Data]Name:="test0"
SAVE RECORD([Test_Data])
REDUCE SELECTION([Test_Data];0)
UNLOAD RECORD ([Test_Data])

Or

QUERY([Test_Data];[Test_Data]Name="test@")
LOAD RECORD ([Test_Data])
`Try to delete the record.  Shouldn't be able to since in Read Only
DELETE RECORD([Test_Data])
QUERY([Test_Data];[Test_Data]Name="test@")

` Should fail
(Continue reading)


Gmane