Newbies proless Posted October 10, 2017 Newbies Posted October 10, 2017 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.
Lee Smith Posted October 10, 2017 Posted October 10, 2017 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
Fitch Posted October 10, 2017 Posted October 10, 2017 The button would perform a script: Duplicate Record Set Field[ fieldwithnumber ; fieldwithnumber - 1 ] 1
Newbies proless Posted October 10, 2017 Author Newbies Posted October 10, 2017 Thanks. I tried to figure out where i need to paste your script but can't figure it out.
LaRetta Posted October 10, 2017 Posted October 10, 2017 (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 October 10, 2017 by LaRetta 1
Newbies proless Posted October 11, 2017 Author Newbies Posted October 11, 2017 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
LaRetta Posted October 11, 2017 Posted October 11, 2017 Select the object which is your button. Right-click to bring up the field options. Select Button Setup. 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 proless Posted October 11, 2017 Author Newbies Posted October 11, 2017 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
Fitch Posted October 11, 2017 Posted October 11, 2017 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now