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
|
|
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.***