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

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

Recommended Posts

  • Newbies
Posted

I have built a database for our departmental inventory. We do inventory each year, and as we find each item in the inventory, we have a "found" field, which we mark "yes" if "found" or "no" if we know that the item was lost or stolen during the year. (these marks are courtesy of checkboxes.) We also, regularly send items to salvage (we are an university) and would like an automated way to automatically mark items that go to salvage as being "found." I built a button to mark the items as "salvage" in the "location" field, but would now like, any items with "salvage" in the "location" field to automatically be marked "found." How on earth do I do this?

Posted

Okay, for the existing records:

Show All Records (Ctrl + J)

Go to your "found" field -- i.e. put your cursor in it.

Go to the records menu

Choose Replace Field Contents

By Calculation

Calc Is: If( Location = "Salvage" ; "Yes")

In the long term -- i.e. if this isn't a once of thing, just change found to be an auto enter field that says: If( Location = "Salvage" ; "Yes" ; FoundField )

Replace field contents is on -- you'll have to make sure all the auto enter fields re-evaluate though.

Posted

Put a calculation in the "Found" field.

Case(Location = "Salvage";"Yes";

not IsEmpty(Location);"Yes";

"No"

)

Uncheck "Do not replace exisiting value"

Now if you enter Salvage in location you get Found,

if you enter something else, like warehouse, you get Yes and if you have nothing entered you get "No."

Of course you can add or subtract from there.

HTH

Al

Posted

Hi cellojello7 and welcome to the forums. :welcomesign:

You have at least two options. First, since you have a script to mark the Location of an Item as "Salvage," you can merely add another script step to set the "Found" field as "yes" ... use the Set Field script step. This may be the simplest and least invasive approach.

Another method alters the "Found" field to an auto-enter calculation. In short, when "Salvage" is entered in the "Location" field, "yes" is automatically entered in the "Found" field, and it cannot be edited. When the Location is any other value, users can mark the "Found" field as "yes" or "no." It works kind of like a little switch.

Attached you'll find an example file (barest of minimums) to illustrate the concept. I exercised creative license in a couple of places:

• The "Found" field uses a radio button set, instead of checkboxes, to minimize the possibility of both "yes" and "no" being entered (seems one might want to prevent that from happening).

• The "Location" field uses a drop-down list, instead of a script, since I couldn't accurately assume how your script may operate. Further, this may help streamline data entry.

Caveat ... Since "Found" is dependent on "Location" in this scenario, there's a down-side only you can evaluate ... when Location is changed from "Salvage" to some other value, users must decide whether to edit the "Found" field. For that reason, I used a Case statement in the auto-enter calculation so you could add other criteria or "tests" that would set "yes" or "no" in the Found field.

Experiment with the file and let us know if you have any questions. Hope this helps.

LostandFound_01.fp7.zip

Posted

For something like this you really shouldn't be using a script anyway, it's kind of pointless. I suggest you really take a look at the auto enter for future use, or the replace field contents for filling in the old blanks.

This topic is 6612 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.