Jump to content

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

Recommended Posts

Hi! I hope I'm posting this in the right place, and that it isn't TOO simple a question. I'm still a newbie, and am working on a pretty straightforward contact management database in FM Pro 11. Thanks in advance for your help!

 

I need to attach files to quite a few contacts, so I've made a Files tab and added six container fields (and can add more as needed). My problem: I don't know how to add a tiny field next to the tab that shows how many files exist for that contact. I imagine that I'd need to create a function that checks to see which container fields have files, and adds them up. How do I do that?

 

(Also, if there's a better way to attach files to a contact, do let me know. I'm just doing it this way because I thought it was the only way.)

 

 

Link to comment
Share on other sites

Make a separate table for Files.  Each record contains an ID number field (with auto-entered serial number) and the container field.

 

Create a join table between Contacts and Files named ContactFiles.  Each record contains a field for ContactID, FileID, and other information (such as date, etc) relating to that one contact and that one file.  Relate that table to Contacts by Contact::ID =  ContactFiles::ContactID and ContactFiles::FileID = Files::ID.

 

Now, if you want to display the files related to a contact, place a portal to Files on your Contacts Files tab.  To display a count, create a calculation field on a layout based on Contacts: RelatedFilesCount = Count(Files; ID)

  • Like 1
Link to comment
Share on other sites

This topic is 4052 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.