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

Error message for External Find script

Featured Replies

Hi,

I have two related databases: Clients and Agents. As a client is entered into the Client database I want to be able to assign an agent from the Agent database. This is how I did it.

In Client when I hit the Assign Agent button, this triggers an "Add Agent" script which runs the external script, "Get Agent" in Agents. The steps in this script are (sub script is denoted by >>>>):

Perform Script[sub-scripts, "Select Agent"]

>>>>Enter Find Mode [ ]

>>>>Go To Field ["Last Name"]

>>>>Perform Find [ ]

>>>>Pause Resume Script [ ]

Copy[select, "Agent# "]

Perform Script[sub-scripts, External: "Clients"]

This last step triggers a script in Clients that just pastes the selected agent's # on the client record, bringing up the agent name in a portal. Every thing works ok but I get this error message right after I hit the Assign Agent button but before I actually get to the Agent database:

"There is no valid criteria in this request. Type a valid criteria before clicking Find" and there are three buttons Cancel, Continue and Find.

Like I said the scripts work but I would like to get rid of the error message. Does anyone have any idea how I could re work these scripts to get rid of the error message?

Thanks,

Joe

smile.gif

Here are two alternatives to your current method:

Option 1: Value list

1. Define a value list in Clients based on Agent Name in Agents.

2. Define a relationship from Agent Name in Clients to Agent Name in Agents

3. Define your Agent Key in Clients to Lookup based on the above relationship. Allow it to copy if contents are empty, and if no exact match is found then tell it to enter nothing (the last option in that list). When the user selects an Agent for a particular client from a drop-down list or menu, the Agent Key will automatically update.

The drawback to this method is that Agent Names, stored in Agents, must be unique in order for this method to work.

Option 2: Scripted Select

This method is a little more involved but more reliable, especially if more than one agent has the same name. For the sake of my fingertips I'll give you a basic rundown:

1. User clicks on "Assign Agent" button in Clients, which takes you to

2. A list layout in Agents showing just the names of Agents, sorted alphabetically or whatever. Static text at the top of the layout tells the user to select an agent from the list. Insert a Show All Records step to be sure all agents are listed.

3. User clicks on an agent name, which

4. Assigns the unique Agent key to a global text field in Clients and

5. Returns to a different layout in Agents and hides the window, returning the user to Clients.

I recently used Option 2 in a solution for a client, but I've used both with success. I hope this helps!

The reason your script doesn't work is that two of the steps are interchanged. In the external script:

>>>>Enter Find Mode [ ]

>>>>Go To Field ["Last Name"]

>>>>Perform Find [ ]

>>>>Pause Resume Script [ ]

should read:

Enter Find Mode [ ]

Go To Field ["Last Name"]

Pause Resume Script [ ]

Perform Find [ ]

as it is, you completing the find with no criteria, before you pause for data entry. Kind of like walking through a door before you open it (ouch!).

My two cents worth on how REALLY to do this:

1) Create a constant relationship both ways between Clients and Agents. (A find in this forum will explain how).

2) Create a global text field gAgent and a global number field gAgentNum

3) In browse mode, in Clients, enter an agent name and click a Find button.

4) The "Find" Buttons navigates to Agents, enters Find Mode, and uses a Set Field to Set Field ("Last Name", "ConstantRel::gAgent"), then does the find.

5) The script in Agents then tests for one or more found records. If one only, it uses Set Field ("ConstantRel::gAgentNum", "Agent Number"). If more than one, it navigates to a list view and pauses for the user to select an agent from those with the last name entered. A script attached to a clear button over each agent in the list then does the Set Field ("ConstantRel::gAgentNum", "Agent Number") and returns to Clients.

6) In Clients, the calling script then does a Set Field ("Agent Number", "gAgentNum")

-bd

6) In Clients, the calling script then does a Set Field ("Agent Number", "gAgentNum")

Whoops, my mistake -- I forgot this crucial step in my second method.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.