August 9, 201411 yr Newbies I wrote an app about 6 months and I can't remember how I did this: 1. Add a file to a container (store only the reference to the file) 2. Populate a field with the name of the file I can't find the script or a trigger that allowed me to do this. I remember writing something to do this because I had to parse out the name and set the field with the file name so I know I am not crazy. Note: There is no script trigger or button setup on the container field or the field I populated with the name. I also don't see a script (under manage scripts) that is parsing a file path so I don't think I did it with a script. I guess my question is how does filemaker know when a container field is populated, and where would the script be to do something when it changes. THIS IS DRIVING ME CRAZY!
August 9, 201411 yr To trap a field being changed using any of the field-level triggers (onModify, onSave, onValidate,...) To get the path of a container you can use any of the GetContainerAttribute function switches, like: GetContainerAttribute ( theContainer ; "all" ) or set a text field to the container field and you will get some info, including the path
December 1, 201411 yr You may have done with a calculation field which resturn filename using GetAsText ( container_field) then parsing "/" Source
December 14, 201411 yr I wrote following script and solved my issue. Make sure while running the script the new path is accessible. SCRIPT Update FilePath: Go to Record/Request/Page [ First ] Loop Set Variable [ $old; Value:GetAsText ( Table::container_field ) ] Set Variable [ $new; Value:Substitute ( $old ; "/old folder/" ;"/new folder/" ) ] Insert File [ Table::container_field; “$new” ] [ Reference ] Go to Record/Request/Page [ Next; Exit after last ] End Loop
Create an account or sign in to comment