Newbies phcaputo Posted August 9, 2014 Newbies Posted August 9, 2014 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!
Wim Decorte Posted August 9, 2014 Posted August 9, 2014 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
haseebiqbal Posted December 1, 2014 Posted December 1, 2014 You may have done with a calculation field which resturn filename using GetAsText ( container_field) then parsing "/" Source
haseebiqbal Posted December 14, 2014 Posted December 14, 2014 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
Recommended Posts
This topic is 3883 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