Re: Record locking woes

2020-12-10 Thread Ben Kershaw via 4D_Tech
Alan Tilson wrote:

>Locked By does return the locking process, user, machine, and proc name.

Is the server holding the lock, or is another client? If it’s on the server, is 
it in the twin process for the client, a twin process for another client, or 
another process on the server?

Regards,
Ben
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Record locking woes

2020-12-10 Thread Ben Kershaw via 4D_Tech
Douglas von Roeder wrote:

>One of our 4D musicians needs to make a blues song out of this.

I play bass & piano, but haven’t written anything original. Maybe now’s the 
time:

“Record locking woes”
“My index dun left me”
“My old code got no Class”
“Everything seems OK”

4/4 in D flat, naturally.

Hmmm…

Regards,
Ben
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Record locking woes

2020-12-09 Thread Ben Kershaw via 4D_Tech
Alan Tilson wrote:

>I'm having a record locking problem where I cannot understand how the
>record is staying locked. There is no open transaction and no record stack
>(Push Record).

It could be that the process on the server (the one the trigger runs in) still 
has it loaded in a locked state. To test this, create a method with the 
“Execute on Server” attribute set, and call UNLOAD RECORD from that method. 
Call the method from the client when you close the edit window; the method will 
run in (what is known as) the “twin” process on the server and free the record.

When a new process starts, all tables are in a read/write state, and any 
records loaded will be locked to other processes/users. I run a standard init 
method for new processes that sets all tables to read only, and also runs a 
method on the server that does the same thing for the “twin” process.

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Ben Kershaw via 4D_Tech
Tim Nevels wrote:

>if you want to use entities or use collections AreaList Pro is out of the 
>picture.

As posted on e-node’s forum two weeks ago: “ALP v11 will definitely support 
entity selections and collections. Mostly it seems to already work in ALP 
11.0a5"

It may not do everything you want in the first version, but don’t worry - only 
babies don’t understand they can’t have everything immediately.

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: NTK 32K limit in TCP Receive

2020-04-09 Thread Ben Kershaw via 4D_Tech
Jeffrey Kain wrote:

>Why? :)
>"The bufferSize parameter indicates the maximum number of bytes to read. If it 
>is omitted or set to 0, the plugin will use the maximum size for a text 
>variable (32000 bytes).”

Have you tested it to make sure it’s not just a documentation error?

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Problem with component

2020-03-03 Thread Ben Kershaw via 4D_Tech
Doug Hall wrote:

>This particular component is Foundation, but unless it's corrupted somehow,
>I don't think that's relevant to my problem. While the component structure
>itself validates with a checkmark in the Maintenance Security Center, the
>structure index doesn't seem to work. I can move my structure index of the
>component to another folder, reopen the component (thus rebuilding the
>index), build the component, placing the built component into my parent
>DB's (components) folder. Yet, when I +K on a component method
>from the parent DB, it will always point me to some local object method
>instead. It used to simply show me that it was a component message, but it
>would at least point me to the right thing.

>Yesterday, I realized that it's not even getting some of my constants
>right. If I do Alert2("Some message";FND_Dlg_NoteIcon), it shows me the
>Fnd_Dlg_WarnIcon icon, instead.

Doug,

Are you using a compiled component, or are you just putting the component 
structure in the host’s “Components” folder? You said “… build the component” 
so I’d assume compiled, but just making sure.

Either way, you won’t be able to edit the component methods while in the host, 
even if you’re using the source structure in the Components folder. You can 
trace execution (if not using a compiled component), but you can’t edit or even 
view the code.

Regarding the constants, if you’re using the source DB in the host’s Components 
folder you’ll need to include the constants file(s) from the component DB in 
the host’s “Resources” folder, as well as include the “.4DIndy” file from the 
component’s folder in the host’s “Components” folder. If you’re using a 
compiled component, you don’t need either of these (and I imagine including 
them would cause problems).

Have you checked the host’s Resources folder to make sure you don’t have any 
duplicate IDs?

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Bug in SMTP methods in 4D Internet Commands plugin

2019-02-08 Thread Ben Kershaw via 4D_Tech
Randy Engle wrote:

>Received both emails  including:  " Invalid subject containing changed by” So… 
>Something else is hokey-pokey

I can’t figure what it’s all about. It fails using a brand new database, on two 
different machines, on two different networks, connected to two different SMTP 
servers. In 30 years of 4D development, this is the strangest issue I’ve seen.

Thanks for testing it out. I figured it couldn’t be an IC plugin bug, but 
everything I saw pointed to that. Oh well - it’ll be fun finding out what it 
really is.

Thanks,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Bug in SMTP methods in 4D Internet Commands plugin

2019-02-07 Thread Ben Kershaw via 4D_Tech
I've discovered a bug in the 4D Internet Commands SMTP methods. If the message 
subject contains the text "changed by", there won't be any errors returned but 
the e-mail will not be sent.

I've tested it on the following versions, all running on macOS 10.13.6
   * 4D 16.3HF4 64-bit, 4D Internet Commands 16.3 build 16.224100
   * 4D 16.4 64-bit build 16.226553, 4D Internet Commands 16.4 build 16.226553
   * 4D 16.4 32-bit build 16.226553, 4D Internet Commands 16.4 build 16.226553
   * 4D 17.0 build 17.225365

I've also tested it running under Windows server.

I've tested it on different machines, using different SMTP servers, on 
different networks. Same result. I find it hard to believe that having "changed 
by" in the message subject would cause the e-mail to not be sent, but my 
testing shows otherwise. Still, I've enclosed a small method below, and I'd 
appreciate it if others could try it out and let everyone know the result 
(you'll need to set the variables for the STMP server, addresses, and 
username/password if your SMTP server needs authentication).

This is a weird one. I'm assuming it's caused by some old debugging code that 
was left in place, but who knows.

Thanks,
Ben Kershaw


C_TEXT($tSMTPServer;$tEMailFrom;$tEMailTo;$tUserName;$tPassword)
C_LONGINT($lSMTPServerPort;$lMessageID;$lError;$lArrayElement)

$tSMTPServer:=""
$lSMTPServerPort:=25
$tUserName:=""
$tPassword:=""

$tEMailFrom:=""
$tEMailTo:=""

ARRAY TEXT($atSubject;0)
APPEND TO ARRAY($atSubject;"Valid subject")  //This will work fine
APPEND TO ARRAY($atSubject;"Invalid subject containing changed by")  //This 
won't return an error, but the e-mail won't be sent

For ($lArrayElement;1;Size of array($atSubject))
$lMessageID:=0
$lError:=SMTP_New ($lMessageID)
$lError:=SMTP_Host ($lMessageID;$tSMTPServer)
$lError:=SMTP_From ($lMessageID;$tEMailFrom)
$lError:=SMTP_Subject ($lMessageID;$atSubject{$lArrayElement})
$lError:=SMTP_Body ($lMessageID;"This is the message body";2)
$lError:=SMTP_To ($lMessageID;$tEMailTo)
If ($lSMTPServerPort#25)
$lError:=IT_SetPort (2;$lSMTPServerPort)
End if 
If ($tUserName#"")
$lError:=SMTP_Auth ($lMessageID;$tUserName;$tPassword)
End if 
$lError:=SMTP_Send ($lMessageID)
$lError:=SMTP_Clear ($lMessageID)
End for 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Getting the workstation name for a locked record

2019-01-23 Thread Ben Kershaw via 4D_Tech
Jeffrey Kain wrote:

>We have a bunch of dedicated job clients that all log in to 4D with the same 
>username. When a locked record occurs (I'm using LOCKED BY),
>I want to display the workstation name that's holding the lock... is there a 
>way to get this, other than to assign each workstation a unique username?

Take a look at "Get locked records info”: 
https://doc.4d.com/4Dv16/4D/16.4/Get-locked-records-info.301-3978761.en.html

"The Get locked records info command returns an object containing different 
information about the currently locked record(s) in aTable.
Note: The command works only with 4D and 4D Server. It returns an invalid 
object when called from 4D Remote. However, it can be called in this context if 
the "Execute on server" option is activated for the calling method. In this 
case, the object returned will contain information about the server. When 
called from a component, it always applies to the host database.

… Object containing information similar to the LOCKED BY command but applied to 
the record, the difference being that Get locked records info returns the user 
name defined in the system and not that of the 4D user…"

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

4D 16.3HF4 Windows 64 bit?

2018-08-22 Thread Ben Kershaw via 4D_Tech
Is there a 64 bit version of v16.3HF4 for Windows? I don’t see any 64 bit 
Windows versions in the hotfix area on the forums. I see the server, but not 
the single user/client version.

If I need 64 bit Windows clients, am I forced into using an R release?

Thanks,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Execute on Server Method Attribute

2018-07-14 Thread Ben Kershaw via 4D_Tech
On Jul 14, 2018, at 11:12 AM, Stephen J. Orth wrote:
> 
> I'm struggling with designating a method to run on the server.  The method
> has 9 parameters which are passed to it:
> 
> 1. Text Variable
> 2. Date Variable
> 3. Time (Long) Variable
> 4. Date Variable
> 5. Time (Long) Variable
> 6. Pointer To Array
> 7. Pointer To Array
> 8. Pointer To Array
> 9. Pointer To Array
> 
> When the method is called and executed on the Server, I'm getting an error:
> 
> Accessing a parameter that does not exist

Is one of those arrays a pointer array? I’m guessing so, because that doesn’t 
work and results in that error message. A pointer to other array types works 
fine, but not a pointer array. Sorry.

It should work, since you can send pointers to an EoS method, but… it doesn’t. 
4D could probably make it work, but they haven’t.

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Bug in PrintList Pro v6 and only printing break levels

2018-06-20 Thread Ben Kershaw via 4D_Tech

> On Jun 20, 2018, at 1:36 PM, Jim Hays wrote:
> 
> They recently put out a new PLPv6 beta with updates to break handling.  If
> you aren't already using that give it a try.
> PLP 6 was crashing for us with multiple break levels, the new beta is
> working well so far.

Jim,

Thanks for the reply. I tried v6.0.1b3 yesterday and it still had the issue, 
but it’s nice to hear they’re working on it. Hopefully they’ll be another beta 
soon.

Thanks,
Ben
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Bug in PrintList Pro v6 and only printing break levels

2018-06-19 Thread Ben Kershaw via 4D_Tech
For anyone upgrading to PrintList Pro v6 you may want to know about (what I 
think is) a bug. If you only print the break levels and not the detail rows 
using the “PL_SetColOpts” command and setting the third parameter 
(hideDetailArea) to 1, it will result in an output of “###Undefined value###” 
instead.

This didn’t happen in v5, and it happens in 4D v15 and v16. I’ve reported it to 
e-node, but I thought others might want to know as well.

I could be wrong and perhaps I’m configuring the PrintList area incorrectly, 
but at a minimum it’s a difference between v5 and v6.

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What exactly is the scope of the On err call between 4D server & Client?

2017-07-07 Thread Ben Kershaw via 4D_Tech
Kirk Brooks wrote:

>Yeah, so I'm talking about a method with the Execute on server attribute (or 
>property - whatever) checked.

When a method with this property checked is executed, it runs in the context of 
the servers “twin” process (which isn’t really a twin, since it doesn’t really 
share anything with the client process). If you want your OEC method called for 
an error in that method, you have to set that in the server processes context.

Do you have some sort of generic “init process” method that you call whenever 
you start a new process? If so, create a new method with the “Execute on 
Server” attribute checked, and then call THAT method from your “init process” 
method; this will initialize the server processes context.

I have a method called “InitServerProcess_sv” with the EoS property checked, 
and I call it from my InitProcess method. It sets up the OEC method and does a 
few other things. Has worked like a charm for years.

Keep in mind, though, that unless you pass something back in a parameter (or 
handle it some other way), the method running on the client doesn’t know that 
there was an error during execution on the server - the error method was called 
on the server, so anything that happened during your error handler happened on 
the server and doesn’t change anything on the client.

Regards,
Ben

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: AS400 & 4D...

2017-06-10 Thread Ben Kershaw via 4D_Tech
Robert wrote:

> I have an existing client that is purchasing another company that’s using an 
> AS400.  What are my connectivity options via 4D?  ODBC?

Wow - I haven’t seen one of those things in a long time. When they came out I 
was using 4D v1.0.6.

It’s going to depend on what’s running on it. If it’s been upgraded over the 
years (and even has an IP stack on it), it may be running web apps and 
(assuming they have developers) you may be able to do REST calls. Maybe.

Most likely it’s running DB2, which means ODBC at best.

If you can’t get in via ODBC and you have to do some sort of file transfer, be 
aware that the AS/400 uses EBCDIC. You’ll be better off just dropping the 
client.

Kidding.

(not really)

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**