**
I first learned about the "TR.field having a value in a push fields" during a PT&T class, and always accepted it, but had never fully investigated it (via SQL logs) until just before I posted, so yeah, I did check it.  Some other things to keep in mind...

When ARS gets the DB value it is using the Request ID, so the search is indexed - very fast.  Since this only applies to filters, the processing is done on the server and typically the connection between ARS and the DB is optimized.  If not, then you have bigger worries than an extra SQL call to the DB.  :-)  Plus, the cost of the call is usually worth having the code function correctly.

Also, ARS is smart enough to know that the DB value by its nature will be null on submit, and therefore it doesn't even do a search against the db.

My experience and testing is with an unpatched 6.3 server, so I don't know if previous versions behave differently.

Cheers,
Thad
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- Antoine de Saint-Exupéry


"McKenzie, James J C-E LCMC HQISEC/L3" <[EMAIL PROTECTED]>
Sent by: "Action Request System discussion list(ARSList)" <arslist@ARSLIST.ORG>

08/28/2006 01:02 PM

Please respond to
arslist@ARSLIST.ORG

To
arslist@ARSLIST.ORG
cc
Subject
Re: How to verify if the current value entering exists on the dat abase





**
Thad:
 
I take that you checked this.  I was under the impression that the TR.fieldname value was only set if the field was actually changed.  This will make a difference in the way that I write workflow from now on.  One thing is that I avoid touching the database as much as possible.  Reading values from the DB does take time and if you have a clogged/slow network or a slow/overloaded database server this can become very noticiable, even with indices, at the user level.
 
James McKenzie
L-3 GSI


From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Thad Esser
Sent:
Monday, August 28, 2006 11:55 AM
To:
arslist@ARSLIST.ORG
Subject:
Re: How to verify if the current value entering exists on the database


**
Misi,


You beat me to it.  :-)


I think the common misconception here is the belief that the TR value will have a value only if the field changed, which isn't true.  If the field is part of a push fields action, then TR.field will have a value regardless if it has changed or not.  You can see this in the SQL log.


I'm still trying to think of a valid use of the TR value.  It seems to me that in all cases either you want the DB.field value or just the "field" value.


Thad

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- Antoine de Saint-Exupéry

"Misi Mladoniczky" <[EMAIL PROTECTED]>
Sent by: "Action Request System discussion list(ARSList)" <arslist@ARSLIST.ORG>

08/28/2006 11:36 AM

Please respond to
arslist@ARSLIST.ORG


To
arslist@ARSLIST.ORG
cc
Subject
Re: How to verify if the current value entering exists on the database







Hi,

Just for the record...

The following qualification does not verify that a field has been changed:
('TR.field' != 'DB.field' AND 'TR.field' != $NULL$)

You should rather use something like this:
('field' != 'DB.field')

If you like to perform the check only if the field has been changed to
something other than NULL, the first version would work, but I usually
write it like this:
('field' != 'DB.field' AND 'field' != $NULL$)

A unique index would work just as good.

Active Links is needed if you want to make the user aware of the error
before she/he saves the record.

      Best Regards - Misi, RRR AB, http://www.rrr.se/sv/

>     Why make it so complicated
>
>
> Filter 1:
>
> ( 'TR.field' != 'DB.field') AND ( 'TR.field' !=  $NULL$ )
>
> Action, set field, 'field' = $field$ to a tmp field, use first matching
> request, else set to null
>
> Filter 2: Check if the tmp field is null or not, and give an errormessage
> if not null.
>
> L ars
>
> -----Original Message-----
>
>
> From: Action Request System discussion list(ARSList)
> [mailto:[EMAIL PROTECTED] Behalf Of Addis Solomon
> Sent: Monday, August 28, 2006 5:43 PM
> To: arslist@ARSLIST.ORG
> Subject: Re: How to verify if the current value entering exists on the
> database
>
>
> **
> Kelly,
> I followed instruction # 2 however, the lastcount is counting all the
> records that are on the form instead of only  values that matched the
> current value.  Any recommendation?
>
> Kelly Deaver <[EMAIL PROTECTED]> wrote:
>
> **
> There are several ways, depending on what you are trying to accomplish.
> I'm going to call the field you are interested in FieldA in my examples.
>
> 1. If you are trying to assure that no two records have the same value in
> a particular field (FieldA), create a unique index for that field. In the
> Admin tool, open the form and select form>form properties. On the Index
> tab, move the desired field to the right column and check the "unique" box
> below. Save. When the user submits a new record, it will say that entry
> violates a unique ID on FieldA.
>
> 2. Add a field, FieldB, to number field to check the result of an active
> link you are going to create.Create an active link that runs on loose
> focus, run if - FieldA != Null. Select a set field of the field action.
> Query the form name of the same form (not CURRENT SCREEN) where $FieldA$ =
> 'FieldA'. Set the no match = set the field to null. Set multiple match =
> Use first matching request. Set Field - FieldB = $LASTCOUNT$. This will
> tell you how many already submitted records match the current value in
> FieldA. You can then create an error message if FieldB not NULL that tells
> the user in more detail what you want them to change.
>
> 3. Do the same thing with a filter to check on submit and block the submit
> action if you like.
>
> 4. If you aren't trying to block, but rather find matches, you can do the
> same as #2 except instead of setting multiple match to Display a List.
> ---------------------
> Kelly Deaver
> Director, ITSM Practice
> Xinify
> [EMAIL PROTECTED]
>
>
>
>
>
> -------- Original Message --------
> Subject: How to verify if the current value entering exists on the
> database
> From: Addis Solomon <[EMAIL PROTECTED]>
> Date: Sun, August 27, 2006 12:27 pm
> To: arslist@ARSLIST.ORG
>
> **
> Can anybody help me how can I check if the current value entering already
> exists on the database?
>
> Thanks in advance for your help
>   _____
>
> All-new
> <http://us.rd.yahoo.com/evt=43256/*http://advision.webevents.yahoo.com/mailbeta>
> Yahoo! Mail - Fire up a more powerful email and get things done faster.
> __20060125_______________________This posting was submitted with HTML in
> it___
>
> __20060125_______________________This posting was submitted with HTML in
> it___
>
>
>
>
>   _____
>
> Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great
> <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>
> rates starting at 1¢/min. __20060125_______________________This posting
> was submitted with HTML in it___
>
>
> _______________________________________________________________________________
> UNSUBSCRIBE or access ARSlist Archives at http://www.wwrug.org
>

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at http://www.wwrug.org

***IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature.***

__20060125_______________________This posting was submitted with HTML in it___
__20060125_______________________This posting was submitted with HTML in it___

***IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature.***

__20060125_______________________This posting was submitted with HTML in it___

Reply via email to