Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Portal frustration!

Status
Not open for further replies.

cherphas

Programmer
Jun 5, 2002
24
CA
Hi,
I'm working on a db for an Art Bank and I want to create a "Loan History" field. This would track every loan an artwork would have. The user could add the name of the client that loaned an artwork and the date it was loaned, then add additional names if it was loaned again and it would be sorted by date. For example, John Smith loans an artwork on June 2001, we enter his name and the date. Billy Bob loans the same artwork on august 2002, we add his name to the same field and we now see two rows in the field and the new name is on the top. I'm pretty sure this would require the use of portals, but I tried and it doesn't work!!

The way I have it now is: I have the main "Artworks" db and a "Loan History" db. Every record in "Artworks" has an Artwork_ID. But I'm not sure how to do the relation with the two. Is portals the way to go?
 
You have the right idea going - but you might be better off not entering the new information in the portal window.

You can create a small entry form just below the portal using Global fields. The users would enter the information on the form and click an ADD button.

The script for this button would copy the current Art_ID number to a global field then run a script in the Loan History file that creates a new record and copies the information from the global fields. The last part of the script would return to the Art file and clean out the global fields at the bottom of the portal.

When the record is added to the history file and you go back to the Art file - the portal will automatically refresh and resort the information the way you want it displayed.

The relationship between the Art and History files should be based on the Art_ID field. It is in the relationship setup that you can determine a sort order.

If you want an example of how to set this up - leave your email and I'll send it to you.

HTH


Im Steven B
 
hmmm. I see how it works, but I never dealt with complexe filemaker pro script before. I have a "Enter new Loan" field(global field?) and an Add button setup. When I click the button it copies the data to the clipboard, but then I'm stuck. How can you copy stuff to another file?

And another thing, is it normal that I can't access the field in the portal?

Thanks for you help!
 
I managed to get it working from what you told me.

I Have a portal to an empty database with three fields: Art_ID, Client name and Date. In the main database I have a portal that point to the first database. Below the portal I have "Enter new Loan", which is a Global Field, with the ADD button. When I enter text in the Global Field and click ADD, it does the following script:

-copies the Art_ID from the main databse to the clipboard
-performs a script in the first databse:
-Create a new record
-Paste the Art_ID in the Art_ID field
-Inserts the client name(InsertCalculatedResults)
-Same thing for Date
-Go back to Main database(Go to related record)
-Now we're back to the script in the main databse, a script that clears both fields(clear)

Basicly exactly what you said! Thanks for you help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top