mattc Posted June 18, 2002 Posted June 18, 2002 I have 2 database tables: The parent database table (Contract) displays related Contract Logs, from the Child database table (Contract Logs) via a portal. From the parent database, I can use the command Goto Related Record to select the relevent record in the Child Database. Is there anyway that once a record in the Child Database is selected, the relevent portal row in the Parent Database can be selected. Everytime I try to highlight a SPECIFIC portal row (by file contents for example), only the first row gets selected. The other portal row option (first,last,next etc) aren't specific. Any Ideas? thanks
keshalyi Posted June 18, 2002 Posted June 18, 2002 Once you've chosen a specific child object, have it step from portal row to portal row (using the go to portal row, next command), and test to see if the key of the portal record matches the key of the selected child object. Kinda obtuse, if anyone knows a better way?
mattc Posted June 18, 2002 Author Posted June 18, 2002 Yes, this works, but I didn't know if there were a more direct way to pick out a portal row. Although it is easy enough to give each child record a unique id, it didn't have one before - It just used the "Contract Ref" in each file. Thanks though - this maybe the ticket
StevenB Posted June 18, 2002 Posted June 18, 2002 If the keys match try copying the key to a global field - then use the Go To Portal Row by Field Value command and select the global field. HTH
mattc Posted June 18, 2002 Author Posted June 18, 2002 It's funny you suggested this - that was my first effort and it did seem to work for a while & then it stopped??? I used the Set Field command to match a local Global Field with the Contract Log Serial Number, and then used the Goto Portal Row (Field Value). In the end, FM seemed to only correspond the numeric figure as it's row number & not it's serial number in any location - does that make sense?! Thanks
LiveOak Posted June 18, 2002 Posted June 18, 2002 I'm not quite sure what action you are really taking when you say "try to highlight". There is a script step to "go to portal row" based upon row number. To create a colored highlight background: Set a global field to the related record number (perhaps by clicking on a portal row and running a script), create a relationship from the related file back to the main file using a Constant = 1 field in each file, then define a calculated container field to provide the background color in the realated file which you display in the main file as a background to a portal row. If the global field is "gMarkedRec" in the main file and gRed and gGreen are container field containing red and green backgrounds: cBackground (calculation, container) = Case (RecordNum = ConstantRel::gMarkedRec, gRed, gGreen) -bd
mattc Posted June 18, 2002 Author Posted June 18, 2002 Sorry LikeOak When I say Highlight, I mean't select the specific Portal Row Record - the solution discussed in the last couple of posts works, but it seems like a 'work-around' - Just interested to see if there was another way. Thanks
The Bridge Posted June 19, 2002 Posted June 19, 2002 I recently had to achieve the same thing for a client. On one layout, the user would click on a person's name. This would take you to another layout showing the info for the company the person worked for and another portal showing all employees. But I wanted the selected person's name to be selected automatically in the employee portal. At first I tried finding the position of the person's unique ID in a valuelist built on same, but that was unreliable and slow. Here's what I ended up doing: I defined a calculation field (number, indexed) in my child database (person.fp5) c_One = 1 Then I defined a summary field in my child database c_Row_Number = Total of c_One (running) Then I created a script that would sort by the same criteria that the portal in my parent file would sort by. In my parent database (company.fp5), I set a global text field to the selected person's unique ID. Then I defined a script which would Go To Related Record (show only related) to find all people related to the company the selected person is related to; then I run the sort script in the child database; I return to the appropriate layout in my parent file and Go To the Portal Row specified by the summary field in my child db, via a relationship between the global person ID in company.fp5 and the unique person ID in person.fp5, i.e. Go To Portal Row (by field: Selected_Person::Portal_Row_Number) I hope this makes sense!
uchujin Posted June 20, 2002 Posted June 20, 2002 I have been using something similiar to peters above, but with a bit less scripting: in Parent file: c_Row#= count(childfile::uniqueID) g_Row# in Child file: n_Row#= auto enter calculated data: ParentFile::c_Row# same concept of setting g_Row# to n_Row#, go to portal row by field value (g_Row#) applies This is more appropriate for scenarios when records in child file will be created through the portal (so the relationship allready exists at creation), and if records in child file will be deleted, must script at the end of the delete process a Replace Childfile::n_Row# with serial #'s starting at 1 (to eliminate gaps that may have been caused by the delete)
Recommended Posts
This topic is 8193 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