Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Perform find script nightmare

Featured Replies

Hi 

I have a text field with a "from" text value

However if the field content is (An) as 2 characters I receive AN and ANN and ANNA and ANIE and so on

How to constrain just to the actual value in the Field so I do not get the whole bunch of words starting or containing those letters?

It must be really simple but I am unable to do it

Thanks

 

1. To find the exact content (of the entire field), search for ==An.

2. To make the search case-sensitive, set the field's indexing language to Unicode.

  • Author

1. To find the exact content (of the entire field), search for ==An.

2. To make the search case-sensitive, set the field's indexing language to Unicode.

Thank you for your kind reply but I forgot to mention this is one step ina script and for mysterious reasons I cant get it to work  while it works perfectly if I do a manual search

the script is like this:

Perform Find [ Specified Find Requests: Find Records; Criteria: Mails::Kind: “Message” AND Mails::How Many Messages: “=” ]

[ Restore ]

Sort Records [ Keep records in sorted order; Specified Sort Order: Mails::From; ascending Mails::DateTime; descending ]
[ Restore; No dialog ]

Loop

Perform Find [ Specified Find Requests: Find Records; Criteria: Mails::Kind: “Message” AND Mails::How Many Messages: “=” ]

[ Restore ]

Go to Record/Request/Page

[ First ]
Enter Find Mode [ ]
Set Field [ Mails::From; "==" & Left ( Mails::From ; Length ( Mails::From ) ) ] Perform Find [ ]
Set Field [ Mails::How Many Messages; Get ( FoundCount ) ]
If [ Get ( FoundCount ) > 1 ]

Replace Field Contents [ Mails::How Many Messages; Current contents ] [ No dialog ]

End If End Loop 

 

However in the search field the script only Paste "==" and not the rest

 

I tried to use th "Insert calculated result" but the same thing happens

How could I solve this problem?

There is not way that i am aware of to add operators in a calculation as they all vanish

 

 

Allow User Abort [ON]  // once script is working properly switch to OFF
Set Error Capture[ON]
Perform Find 
[ Specified Find Requests: Find Records; Criteria: Mails::Kind: “Message” AND Mails::How Many Messages: “=” ]
[ Restore ] 

Sort Records [ Keep records in sorted order; Specified Sort Order: Mails::From; ascending Mails::DateTime; descending ]
[ Restore; No dialog ]

New Window[ window name=process, height=10, width=10, left= -100, top=0 ]    // process routine off screen
Loop
    Enter Find Mode []

    Set Field [ Mails::How Many Messages; "=" ]
    Perform Find []
   
Exit Loop if [Get ( FoundCount ) = 0]
    Go to Record/Request/Page  [ First ]
    Set Vaiable [$from, 
Left ( Mails::From ; Length ( Mails::From ) ) ]
    Enter Find Mode [ ]
    Set Field [ Mails::From; "==" & $from
    Perform Find [ ]
    Set Field [ Mails::How Many Messages; Get ( FoundCount ) ]
    If [ Get ( FoundCount ) > 1 ]
        Replace Field Contents [ Mails::How Many Messages; Current contents ] [ No dialog ]
    End If
End Loop 
Close Window [current]

Hope this helps!

1. In Find mode a non-global field has no value; that's why all you get is the constant "=="; you could capture the field value in a $localVariable before entering Find mode and use that as search value; or use Find Matching records [ Replace ; Mails::From ]

2. Left ( Mails::From ; Length ( Mails::From ) ) is the same as Mails::From

3. What is your script supposed to do, anyway? Counting the number of distinct “From” values with empty count and storing the result in the Mail table itself?

Not sure if that makes sense, but you could write a much shorter script:

Set Error Capture [ on ]
Perform Find [ Specified Find Requests: Find Records; Criteria: Mails::Kind: “Message” AND Mails::How Many Messages: “=” ][ Restore ]
If [ Get ( FoundCount ) ]
  Sort Records [ Keep records in sorted order; Specified Sort Order: Mails::From; ascending Mails::DateTime; descending ]
  [ Restore; No dialog ]
  Replace Field Contents [
    Mails::How Many Messages
;
    Let ( theCount = GetSummary ( Mails::sCountAll ; Mails::From ) ; Case ( theCount > 1 ; theCount ) ) 
  ] 

End If

where Mails::sCountAll is a summary field that counts a guaranteed non-empty field.

Edited by eos

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.