kemo Posted October 10, 2001 Posted October 10, 2001 I'm working with an Employee Database that pulls Job Updates from a Job Entry file into a portal, and sorts by Effective Date with the most recent entry on top. This information is in a portal on a layout that will be used for viewing only, so I unchecked the "Allow creation of related records" to eliminate the blank row at the bottom of the portal. It works great! However... I've now created the layout for updating the employee's record and want to add the information into the portal on this layout, rather than having to switch to the Job Entry File. I duplicated the portal relationship and checked the box to "Allow creation of related records," but when I view this new portal, it is not showing all of my related records but instead has duplicated the most recent record in place of however many records should be showing for that file (i.e. If an employee has 3 entries in the Job Entry file, this portal will show the most recent entry 3 times). I have tried creating a new relationship from scratch to no avail. The only relationship that will work is my original relationship, but I can't use the same relationship for viewing and editing (or can I)? Also, is there a way to put the blank portal at the top? I would appreciate any help. kmoats
Olive Posted October 10, 2001 Posted October 10, 2001 Hi, I'm prety sure your problem in your 2nd portal is due to the fact that you didn't change your fields in the new portal. Which means you have fields from portal 1 into portal 2. Check each field in your second portal and verify that each of them is from the 2nd relationship you created. Either way, you don't need a 2nd relationship because you can create different portals with only one relationship. Just copy your first portal in another layout (or a,ywhere you want) and check "allow creation of related records". Voila ! And to answer your last question : to my knowledge, no you can't put the blank lign on top. O.
kemo Posted October 10, 2001 Author Posted October 10, 2001 Thanks, Olive! I completely forgot about changing my fields to reflect the new relationship, but now it works like a charm! I tried your suggestion of using the same relationship for both portals, but I only saw a check box for "Allow deletion of portal records" in the Portal Setup box. The check box to "Allow creation of related records" is found in the Define Relationship dialog box, and this would affect both portals. That's why I tried the duplicated relationship. Thanks again, Olive!
Rigsby Posted October 10, 2001 Posted October 10, 2001 You can trick FM into putting the empty portal row at the top. Step 1: Create a layout using the portal without “Allow creation of new records” (Lets call it (“entry” Use global fields placed above the portal to look like an empty portal row Create a script to switch to this layout that also sets the globals to empty or 0 values Create a calculating field that shows a button “SAVE” if any of these global fields have a value, and place this on the “entry” layout. Step 2: Create a calculating field (lets call this “last_row” that counts the number of related records: Count(Relationship_name::any field that has a value) Step 3: Attach a script to the calculated field that shows the button, that: If it’s empty, exits the script But, if it says “SAVE” performs the following: 1) Switches to a layout with a relationship that allows the creation of records (Or even better, the relationship portal is just hidden on the current layout) 2) Sets the last portal row fields to the global fields using the go to portal row step (last_row + 1) (See calculating field in step 2) 3) Then deletes the information in the Global fields 4) Returns to the original layout – (The button “SAVE” has gone) Apart from a few polishing touches that’s it – I don’t know your level, so can only hope that you understand me here. If not, let me know and I’ll try to explain in more detail. Rigsby
Recommended Posts
This topic is 8446 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