Neil's suggestions are really spot on. I was thinking about situations
where you would be doing a lot of actual data manipulation. Otherwise there
really is a remarkable amount you can accomplish without clobbering your
current selection.

I know a lot of guys are apprehensive about using SQL, 'cause a lot of us
use 4D in the first place to avoid it. But it can be simple. Let's say I
want to lookup a client email:

// Client_get_email(id)->email
$clientId:=$1
$email:=""
Begin SQL

  SELECT emailField

  FROM CLIENTS

  WHERE Id = :$clientId

  INTO :$email;

End SQL
$0:=$email


​Find in field is also really useful and doesn't change the selection or
current record.


On Sun, Dec 4, 2016 at 1:04 PM, Randy Engle <[email protected]> wrote:

> > In some cases, I need to Query on the same table as the current record
> to find something.
> > Don't want to change the current record, or current selection..
>
> Some of these cases can use set query destination, if you only need a
> record count or a set of records or SQL if you need values, or cut named
> selection use named selection (very fast) to restore a selection. I have
> used all three. There are very few places anymore that I really need the
> overhead of spawning a new process and trying to time them together. In
> fact, I can’t think a a single reason to do so once you are using 4D v15r4
> or above.
>

-- 
Kirk Brooks
San Francisco, CA
=======================
**********************************************************************
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:[email protected]
**********************************************************************

Reply via email to