Jump to content
Server Maintenance This Week. ×

File path for containers


This topic is 3422 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • 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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

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
Link to comment
Share on other sites

This topic is 3422 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.