Jump to content

Does File Exist pointer


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

Recommended Posts

I am using a SuperContainer web viewer to store an email attachment.

When the user selects the document to attach, the actual document name is stored in a text field and the file is then put into the proper SC folder on the FMS computer. This is part of the 'email and notes' communications module of the system.

At an other point in the solution, the user may add a note which uses the same fields as the email (without the address, subject, etc.) At the point of note creation the user may also Upload a document into the SC web viewer.

Finally, on another screen, the user can view in a portal all the notes and emails sent to a contact. This is an abbreviated list view, where I would like to give the user visual feedback IF there is a SC stored document for either an email or a note.

Since the 'attachment' field has an entry if there is an email attachment, it is easy to write a calc with a graphic display when there is an email attachment.

I am looking for a way to produce the same results whenever there is a stored file in the SC viewer for the note record. In other words, regardless of how the file got to SC, I just want an indicator that there is one in a small list portal view.

I've looked at the SCGetInfo function and thought that it would produce the results I need, but have not been able to work out the correct formula.

I appreciate any direction any one can offer.

TIA,

Michele

Link to comment
Share on other sites

SCGetInfo is the correct function to use. You call it in a set variable step or in a calculation (you'd want to use "Case" if you're using a calculation) to find out if there is a file at a location. SCGetInfo will return information about the file if there is one at the location, or blank if there is no file at the specified location.

Usage: SCGetInfo (pathToFile)

If you receive "ERROR" as a response you can call SCGetInfo to find out more detailed information about why you received your error, or you can look through your plugin log. People often forget to call SCSetBaseURL before calling companion plugin functions, so make sure you do that.

You can look through the docuemntation for more detailed information about the SuperContainer Companion Plugin and the SCGetInfo function.

http://www.360works.com/plugins/SuperContainer/plugin-documentation.html#SCGetInfo

Link to comment
Share on other sites

SCGetInfo is the correct function to use. You call it in a set variable step or in a calculation (you'd want to use "Case" if you're using a calculation) to find out if there is a file at a location. SCGetInfo will return information about the file if there is one at the location, or blank if there is no file at the specified location.

Usage: SCGetInfo (pathToFile)

If you receive "ERROR" as a response you can call SCGetInfo to find out more detailed information about why you received your error, or you can look through your plugin log. People often forget to call SCSetBaseURL before calling companion plugin functions, so make sure you do that.

You can look through the documentation for more detailed information about the SuperContainer Companion Plugin and the SCGetInfo function.

http://www.360works.com/plugins/SuperContainer/plugin-documentation.html#SCGetInfo

Thanks for the reply, David. I have read and re-read the plugin documentation, but cannot see why my formula is failing.

I must be missing something in my formula.

SCSetBaseURL is set with the startup script and it returns no errors.

I am using a calculation to display the result of looking for the path. I do not get the correct display when the path exists or does not exist. I get the same results all the time.

Here is my calculation formula.

calc_hasAttachment =

Let( [folderPath = T04d_notes_PREFERENCES||id_constant|::SuperContainer_Hosting_Path & "Attachments/" & T04_NOTES::ID_Note & "/"];

Case(SCGetInfo( folderPath ) ; folderPath ; "no folder path")

)

This produces the result 'no folder path' for all six sample records, 4 of which have a file stored inside the attachments folder. I am not sure if I need the & "/" to close the formula or not, but with or without it the results are the same.

The folders that are created within Attachments are numbered according to the ID_Note number. So the path for record ID 860 that has a stored file would be: http://192.168.0.111:8020/SuperContainer/Files/Attachments/860/

I can see this folder on the server computer and I can see the stored file inside the 860 folder, but I cannot get SCGetInfo to return the the folderPath. It returns 'no folder path'.

It's probably very obvious to you what I am missing, but I cannot see it. I appreciate your help.

Thanks,

Michele

  • Like 1
Link to comment
Share on other sites

I have one more bit of information to add. When the SuperContainer is set to the local computer, the SCGetInfo works as described.

When SC is running on FM Server as a stand alone server application, SCGetInfo does not reply with correct data.

Is this a permissions issue?

Thanks,

Michele

Link to comment
Share on other sites

Ah, yes. You need the plugin installed and enabled to use it with FileMaker Server scheduled scripts. It also needs to be installed for performing Find requests that use a plugin calculation in the field you are searching on, as finds are performed by the server and then the result is sent to you.

Link to comment
Share on other sites

This topic is 4393 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
 Share

×
×
  • Create New...

Important Information

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