axlrose Posted September 28, 2009 Posted September 28, 2009 could someone please give me the code to write a script that will uncheck a certain check box. i have a check box called "to print" I select this so I know I need to print that record, but after I have printed I have to go back and manual click on all the check boxes i had already printed. Is there a way i can find all the checked "to print" check boxes and deselect them all at once? please be specific step by step i have no idea what i am doing. i know how to click find and then select the to print check box and it brings up all the records where to print is checked. hope this all makes sense. any help would be greatly appreciated. :
Vaughan Posted September 29, 2009 Posted September 29, 2009 If the check box field only has the one item "to print" then setting the field to "" will clear the check box. It there is more than one checkbox then use the Substitute() function to remove the value from the string. Be aware that the value is paragraph delimited. Substitute( "¶" & checkboxfield & "¶" ; "¶" & "to print" & "¶" ; "¶" )
axlrose Posted September 29, 2009 Author Posted September 29, 2009 (edited) that does not work. first of all where do i enter this code? there is no where i can just paste this code? i dont know what you mean about paragraphs? Is there a more simple code that makes sense to people who dont do basic programming. I goto scripts then i goto manage scripts then i get a screen of the scripts i click new script and i get a window with a side panel of all these functions i can double click on. it does not allow me to paste the text anywhere? also to me it would make more sense if the code made sense to me like If checkbox is checked then clear check box. end if. and i need the script to go through all of the records and search for these check boxes. you know? i dont think your code you gave me will work with my specific file unless you explain it in more detail to me. for starters do i simply copy and paste the code somewhere in my fm application. if so where? i am really looking for someone to give me the exact code i need. if you cant then explain to me what i need to fill in the blanks with. There is only one checkbox that needs to be uncleared. Edited September 29, 2009 by Guest
mrog44 Posted September 29, 2009 Posted September 29, 2009 print script checked boxes, then uncheck keep in mind you would have to change this script to match your checkbox field and whatever value list you are using for the checkbox, as well as directing the scipt to print what you want. Enter Find Mode [ ] Go to Field [ checkbox::printed ] Insert Calculated Result [ checkbox::printed; 1 ] [ Select ] Perform Find [ ] Loop Go to Record/Request/Page [ First ] Print [ ] Go to Field [ checkbox::printed ] Set Field [ checkbox::printed; "" ] Go to Record/Request/Page [ Next; Exit after last ] End Loop
axlrose Posted September 29, 2009 Author Posted September 29, 2009 i dont want to actual print anything. that will already be done. i just want to uncheck all the check boxes for "to print" can you please bold or italic all the things i need to change . and let me know please. this is very confusing to me. is there a way to copy and paste this script into fm? how do i do that?
axlrose Posted October 5, 2009 Author Posted October 5, 2009 could someone please get back to me on this post?
Raybaudi Posted October 5, 2009 Posted October 5, 2009 Try this... 1) Show all records 2) Click that check box 3) From menu: Records >> Replace Field Contents... >> Replace with calculated result: Specify 4) Insert simply "" ( two quotes ) 5) OK 6) Replace Note that this 6 steps process can be fully scripted and that you must try it on a copy of your DB because it is not "undoable" When ( and If ) it will be good for you, we 'll create that script.
axlrose Posted October 5, 2009 Author Posted October 5, 2009 you are a genius. thanks so much! this was simple and it worked.
Raybaudi Posted October 5, 2009 Posted October 5, 2009 Ok, so now we'll create a script. Scripts >> Manage Scripts >> New 1) Give it a name ( something like Uncheck ) 2) DobleClick "Show All Records" ( under Found Sets ) 3) DoubleClick "Replace Field Contents" ( under Fields ) 4) While the Replace... is active, select: a ) Perform without dialog b ) Specify target field ( choose the name of your checkbox field ) c ) Specify... ( the button under the first specify ) d ) Replace with calculated result >> Specify >> double quote ( "" ) e ) OK f ) OK You can fire that script by clicking its name ( under Scripts Menu ) , or by pressing CTRL + 1, or by attaching that script to a button
axlrose Posted October 5, 2009 Author Posted October 5, 2009 you are great finally someone on here gives the exact answer i was looking for!! thank you for understanding me! your the best! :(
Recommended Posts
This topic is 5905 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