October 10, 20178 yr Newbies 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.
October 10, 20178 yr 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
October 10, 20178 yr The button would perform a script: Duplicate Record Set Field[ fieldwithnumber ; fieldwithnumber - 1 ]
October 10, 20178 yr Author Newbies Thanks. I tried to figure out where i need to paste your script but can't figure it out.
October 10, 20178 yr 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, 20178 yr by LaRetta
October 11, 20178 yr Author Newbies 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
October 11, 20178 yr 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! :-)
October 11, 20178 yr Author Newbies 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
October 11, 20178 yr 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.
Create an account or sign in to comment