Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Filemaker > Re: Re: validat...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 10 Topic 7981 of 8323
Post > Topic >>

Re: Re: validation scripting

by FastWolf <wolfsofast@[EMAIL PROTECTED] > Apr 21, 2008 at 02:38 PM

On Thu, 17 Apr 2008 07:02:50 -0700 (PDT), Grip <grip@[EMAIL PROTECTED]
>
wrote:

>On Apr 17, 1:19 am, FastWolf <wolfsof...@[EMAIL PROTECTED]
> wrote:
>>
>>
>> # titles_lookup = another table occurance of titles
>> # titles::t_id = text field, must be unique
>> # titles::t_idc = calc field that generates a text string by grabbing
>> characters from another text field
>> # titles:t_idv = text field, must be unique
>>
>> I want to create unique values for t_id.  There doesn't seem to be a
>> function for testing validation.
>>
>> My idea was to generate an ID (t_idc), stick it in a field (t_idv),
>> and check to see if it already exists in any record by using a value
>> list.  The value list consists of all values in t_id.  If it's not in
>> the list (does pass validation), then stick it in t_id and save it. If
>> it is in the list (does not pass validation), then append "a" to the
>> end of the ID and check it again.  This way the ID is held out of the
>> value list for comparison purposes, and isn't added to the list if
>> it's in there already.  It seems like there ought to be a way to do
>> this using the ValueListItems function.
>>
>> thanks in advance
>>
>> --
>> FW
>>
>> FileMaker Pro Advanced 8.5 on Windows XP Pro SP2
>> FileMaker Server 8.0 on Windows 2003 Server R2
>
>To check if a record p***** validation by calculation, you can:
>
>Set Error Capture [On]
>Commit Record/Request
>If[Get(LastErrorMessage) =/= 507]
>do this
>Else If
>do that
>End If

Grip,

I love the elegance of this but I can't make it work.  I'm sure I'm
doing something wrong so I'll keep working on it -- I just wanted to
thank you for your help.

>But I agree the method you're using sounds clunky, but I do like the
>use of Value Lists.  Instead of using FM's validation tools, I would
>use this series of script steps to get a valid field value:
>
>Set Variable[$list; ValueListItems(Get(FileName); "ValueListName")
>Loop
>Exit Loop If[ IsEmpty(FilterValues( $list; t_id ))]
>Set [$counter; $counter + 1]
>Set Field[t_id; t_id & $counter]
>End Loop

Now THIS I like -- I know FMP's validation tools are very good but
there's something about scripting my own validation that appeals to
me.  When I get a chance I'm going to mess around with this.

thanks again

-- 
FW

FileMaker Pro Advanced 8.5 on Windows XP Pro SP2
FileMaker Server 8.0 on Windows 2003 Server R2
 




 10 Posts in Topic:
validation scripting
FastWolf <wolfsofast@[  2008-04-17 00:19:38 
Re: validation scripting
"Ursus" <urs  2008-04-17 09:40:26 
Re: Re: validation scripting
FastWolf <wolfsofast@[  2008-04-21 14:42:08 
Re: Re: validation scripting
"Ursus" <urs  2008-04-22 10:46:24 
Re: Re: Re: validation scripting
FastWolf <wolfsofast@[  2008-04-22 10:28:16 
Re: validation scripting
Grip <grip@[EMAIL PROT  2008-04-17 07:02:50 
Re: Re: validation scripting
FastWolf <wolfsofast@[  2008-04-21 14:38:28 
Re: validation scripting
Helpful Harry <helpful  2008-04-18 08:50:42 
Re: Re: validation scripting
FastWolf <wolfsofast@[  2008-04-21 14:32:20 
Re: validation scripting
Lynn Allen <lynn@[EMAI  2008-04-26 12:18:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 18:36:25 CDT 2008.