KevinRan Posted June 30, 2006 Posted June 30, 2006 Hi, I'm a newbie. I thought this problem would be easy to solve for me but I was wrong. I have a table that contains- RecordID, CustName, UserName, Password. I want a layout that would show a list on the left side of the layout containing all CustNames (with scrollbar), a user could click on a name in the list and the Username and Password for that record would show up in two fields on right side of the layout. Can anyone start me off in the right direction? Thanks, Kevin
K1200 Posted June 30, 2006 Posted June 30, 2006 Here's a method: 1. Add a global field to your current table, something like _gRecordID 2. On the table relationship graph, use the + operation to add a copy of your table to the graph. Double click on the copy and rename it to something like CurrentRecord 3. Drag the RecordID located in the new table down to _gRecordID in the old table (to create an = relationship). 4. On your layout, create a portal on the left side displaying only the Customer names from your original table. 5. Right click on the portal's CustName field and select Button Setup. Have the button perform Set Field [_gRecordID; RecordID] 6. Now add the two other fields on the display to the right and have them display out of CurrentRecord
KevinRan Posted July 3, 2006 Author Posted July 3, 2006 K1200, Thanks for the info. However I'm still having trouble. Your item #4 says "displaying only the customer names from your original table." Do you mean when I insert the portal it should be "Show Related Records from original table" and then add field Customer Name from original table? If so, when I create the portal, the original table name is grayed out and I'm only allowed to use related records from the CurrentRecord T.O. Can you tell what I'm doing wrong? Thanks, Kevin
Razumovsky Posted July 3, 2006 Posted July 3, 2006 Hi Kevin, K1200 was on the right track, but omitted a few key points. 1. Add a global field to your current table, something like _gRecordID 2. On the table relationship graph, use the + operation to add a copy of your table OCCURENCE (T.O.) to the graph. Double click on the copy and rename it to something like CurrentRecord 3. create a relationship from OriginalTO:_gRecordID = CurrentRecord::RecordID 4. Format a layout from your Original TO to be a list view of all records with just CustName displayed. In the header, put the related fields CurrentRecord::UserName and CurrentRecord::Password 5. Right click on the list's CustName field and select Button Setup. Have the button perform Set Field [_gRecordID; RecordID]. I would also format the field to not allow entry in browse mode. This will make the record you clicked on the related CurrentRecord, and it's password and Username should show up in the related fields at the top. It would not work before because, as you discovered, there was no relationship set up to display all the original records through a portal. If you wanted to do this with a portal instead of a list, you would need to create a third "X" type relationship from ID to ID that would be an all to all. -Raz
KevinRan Posted July 3, 2006 Author Posted July 3, 2006 Thanks Raz, I'm off early today for the holiday, back on Wednesday. I'll try out your suggestions then. Have a great 4th. Kevin
KevinRan Posted July 5, 2006 Author Posted July 5, 2006 Raz, I got the relationship to work by using the "X" type you suggested. I used it in a portal instead of the list you suggested. The list worked fine on my first try, however I already had a design of multiple layouts and the list didn't fit in aesthetically. I had to mess around with the button behavior a bit until I got it to show the related fields. I couldn't have done it without your help. Thanks again, Kevin
Recommended Posts
This topic is 6716 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