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

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

Recommended Posts

  • Newbies
Posted

If i have field with number.

How i can automatically make that number 1 smaller when i click Duplicate this record button?

So number is now 7 and in next record it is 6.

Posted

Hi proless and welcome to the FM Forums,

I sent you a Private Message, please read it, and the link to Anatomy of a Good Topic.

Lee

Posted

The button would perform a script:

Duplicate Record
Set Field[ fieldwithnumber ; fieldwithnumber - 1 ]

  • Like 1
  • Newbies
Posted

Thanks. I tried to figure out where i need to paste your script but can't figure it out.

Posted (edited)

We don't know if you are working with a sorted set nor whether the record being duplicated is the one 'last visited' or immediately prior so I would suggest, to expand on Tom's suggestion, that you use a script parameter.  Create a script named Duplicate record with these steps:

Set Variable [ $value ; yourFieldHoldingTheNumber ]
Duplicate Record
Set Field [ yourFieldReceivingTheNumber ; $value - 1 ]

Replace the 'yourField' portions of the above script with your actual field name (you can double-click it to insert it).  Then attach this script to a button called Duplicate Record.

And welcome to FMForums!  :-)

Edited by LaRetta
  • Like 1
  • Newbies
Posted

I have never done anything this advanced.

Okay i have now managed to find Script Workspace and created script.

Now i can't figure out how to attach script to Duplicate button.

Thanks

Posted
  1. Select the object which is your button.
  2. Right-click to bring up the field options.
  3. Select Button Setup.
  4. Select Perform Script and find your script in the list and select it.

There are a few cautions with your concept which I'll mention briefly: 

  • I don't know what you are doing but whether it is clearing month-end values, flagging records, or something else, you will want to include error trapping in case a record is locked and thus can't be modified. 
  • You've rated yourself as Beginner so I doubt you are running a standard Developer process such as synchronizing records.  I am concerned that your script suggests that you might be 'over-working' your data.

You have come to the right place for assistance to help you stay on track so your solution works well.  Let us know how it goes! :-)

  • Newbies
Posted

It's just simple database with plain counter type of thing which is 1 smaller in next record.

"Select the object which is your button"

Button is Duplicate button in Status toolbar. So how i select this button?

Thanks again

Posted

If you have FileMaker Pro Advanced, you can override the toolbar buttons via Custom Menus.

Or you can just make your own button on the layout.

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