Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8199 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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!

Posted

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

Posted

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.

This topic is 8199 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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