Scripting a find

4 messages Options
Embed this post
Permalink
Aaron Woitkovich

Scripting a find

Reply Threaded More More options
Print post
Permalink
Hi Experts,
 
I have a field that contains unique numbers separated by a carriage
return.  For example:
 
31245
31278
31299
 
What I would like to do is run a script that parses out each of those
into a find request, so the find would say
 
First Request:      ID = 31245
Second Request:  ID = 31278
Third Request:      ID = 31299 then perform the find when the last value
has been added.  
 
I appreciate any ideas you may have.
 
Thanks,
Aaron
<mailto:[hidden email]>
 
 
 
 
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Richard DeShong

RE: Scripting a find

Reply Threaded More More options
Print post
Permalink
$IDs = table::FieldWithNumbers
(if isempty($IDs) then <DONE>)
$n = 1
$ThisID = getvalue( $IDs; $n )
Enter Find Mode
LOOP
   table::ID = $ThisID
   $n = $n + 1
   $ThisID = getvalue( $IDs; $n )
   Exit Loop if isempty( $ThisID )
   New Record/Request
ENDLOOP
Perform Find
   
-----Original Message-----
From: Aaron Woitkovich Sent: Wednesday, October 21, 2009 12:17 PM

Hi Experts,
I have a field that contains unique numbers separated by a carriage
return.  For example:
31245
31278
31299
What I would like to do is run a script that parses out each of those
into a find request, so the find would say
First Request:      ID = 31245
Second Request:  ID = 31278
Third Request:      ID = 31299 then perform the find when the last value
has been added.  
 
I appreciate any ideas you may have.
 
Thanks,
Aaron
<mailto:[hidden email]>
 
 
 
 
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Aaron Woitkovich

RE: Scripting a find

Reply Threaded More More options
Print post
Permalink

Richard,

Thank you very much for the input, this worked wonderfully.

I appreciate it,
Aaron



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Richard
DeShong
Sent: Wednesday, October 21, 2009 3:50 PM
To: [hidden email]
Subject: RE: Scripting a find

$IDs = table::FieldWithNumbers
(if isempty($IDs) then <DONE>)
$n = 1
$ThisID = getvalue( $IDs; $n )
Enter Find Mode
LOOP
   table::ID = $ThisID
   $n = $n + 1
   $ThisID = getvalue( $IDs; $n )
   Exit Loop if isempty( $ThisID )
   New Record/Request
ENDLOOP
Perform Find
   
-----Original Message-----
From: Aaron Woitkovich Sent: Wednesday, October 21, 2009 12:17 PM

Hi Experts,
I have a field that contains unique numbers separated by a carriage
return.  For example:
31245
31278
31299
What I would like to do is run a script that parses out each of those
into a find request, so the find would say
First Request:      ID = 31245
Second Request:  ID = 31278
Third Request:      ID = 31299 then perform the find when the last value
has been added.  
 
I appreciate any ideas you may have.
 
Thanks,
Aaron

 
 
 
 
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
FM Talk

Re: Scripting a find

Reply Threaded More More options
Print post
Permalink
In reply to this post by Richard DeShong
Sorry for being too late, I just saw that the answer was posted.
Take care.

Script name: SortRecs


# Get how many search request you'll do
Set Variable [ $ValCnt; Value:ValueCount ( List_Field ) ]
Set Variable [ $Val; Value:ID_Field ]

# Set the counter to 1
Set Variable [ $Cnt; Value:1 ]
Enter Find Mode [ ]

# Loop through the lines of IDs
Loop
Set Field [ ID_Field; GetValue ( $Val ; $Cnt) ]

# Exit after last
Exit Loop If [ $ValCnt=$Cnt ]

# New found request
Set Variable [ $Cnt; Value:$Cnt+1 ]
New Record/Request
End Loop

# Prevent error dialog if no records match the criterias
Set Error Capture [ On ]
Perform Find [ ]
Set Error Capture [ Off ]




Your frequent FM talker:
Pavle Ancevski Pajo
New York Hotel Trades Council
[hidden email]




On Oct 21, 2009, at 3:50 PM, Richard DeShong wrote:

> $IDs = table::FieldWithNumbers
> (if isempty($IDs) then <DONE>)
> $n = 1
> $ThisID = getvalue( $IDs; $n )
> Enter Find Mode
> LOOP
>    table::ID = $ThisID
>    $n = $n + 1
>    $ThisID = getvalue( $IDs; $n )
>    Exit Loop if isempty( $ThisID )
>    New Record/Request
> ENDLOOP
> Perform Find
>
> -----Original Message-----
> From: Aaron Woitkovich Sent: Wednesday, October 21, 2009 12:17 PM
>
> Hi Experts,
> I have a field that contains unique numbers separated by a carriage
> return.  For example:
> 31245
> 31278
> 31299
> What I would like to do is run a script that parses out each of those
> into a find request, so the find would say
> First Request:      ID = 31245
> Second Request:  ID = 31278
> Third Request:      ID = 31299 then perform the find when the last  
> value
> has been added.
>
> I appreciate any ideas you may have.
>
> Thanks,
> Aaron
> <mailto:[hidden email]>
>
>
>
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au