Mark Johnson Posted August 19, 2008 Posted August 19, 2008 (edited) I have a Database with a container field called "chart_container". I also have one called "Chart_Page_Number". Both fields are on a layout called Chart View. I have a button called Insert file on the song manager layout. I want to be able to add multiple charts to the same song im currently on and add the next page number for me with out me having to do it all. the ones you see in the database now were all done directly from the chart view not in the song manager layout. I hope i didnt confuse anyone.In a nutshell, i want to click "Insert file" find page 1 pdf file and insert it with page number 1 if no files are attached currently, if it already has a pdf file listed then add a new one to it and make that page number 2 or whatever. and so on if more pages are needed for that particular song.I cant attach my filemaker file because its 12mb zipped so i can email it if you like i just need your email address. Edited August 19, 2008 by Guest Remove CF Formatting.
Fitch Posted August 19, 2008 Posted August 19, 2008 You should make a related table for your pages so you can add as many as you need. Then your "insert" script could go something like this: Set variable( $pages; Count(pages::id) ) Go to layout( *based on related pages, container field on layout* ) New record Insert File Set Field( page number; $pages ) Go to layout( original )
Mark Johnson Posted August 20, 2008 Author Posted August 20, 2008 Hey Mr. Fitch. The script you gave me worked great. I added a copy and past function to it so i can make sure i get the song ID from the previous layout to make sure it puts in in the correct song but other than that, i got it all working. Below is the script i have working thats working great with the exception of one thing. each time i add a song, and click add file or files depending on how many sheets there are for the song sheet it starts numbering the page numbers with 0,1,2,3 and so on. Is there something i can do to have it start at 1 then go to 2,3,4 etc depending on like i said how many sheets i need to add for each song? Copy [ Select; Song_Manager::Song_ID ] Set Variable [ $Chart_Page_Number; Value:Count ( Charts_By_Song_ID::Chart_Page_Number ) ] Go to Layout [ “Charts_By_Song_ID” (Charts_By_Song_ID) ] New Record/Request Insert Object [ Create New: “Adobe Acrobat Document” ] Set Field [ Charts_By_Song_ID::Chart_Page_Number; $Chart_Page_Number ] Paste [ Select; Charts_By_Song_ID::Song_ID ] Go to Layout [ “Song_Manager” (Song_Manager) ]
Fitch Posted August 21, 2008 Posted August 21, 2008 Oops, my fault, change the 6th line of your script to: $Chart_Page_Number + 1
Mark Johnson Posted August 21, 2008 Author Posted August 21, 2008 That worked great. Thank you very very much for your help. I appreciate it.
Recommended Posts
This topic is 5998 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