missedplaced Posted May 15, 2005 Posted May 15, 2005 Ok, I have a portal of only 4 rows. I want to show all the portal records based on and empty field. If portal field has been entered, than it should not show. I am workin with 5.5 so it is not as simple as 7's adding another relationships based on the filter critera. Any ideas? Many thanks in advance!
MoonShadow Posted May 15, 2005 Posted May 15, 2005 "so it is not as simple as 7's adding another relationships based on the filter critera." Well yes it is. In your child file, create a cEmptyField calculation (text) of: If(IsEmpty(thatField); MainID; "") Then create a new relationship from Main:MainID to newRelationship::cEmptyField. Then base your portal on this relationship.
missedplaced Posted May 15, 2005 Author Posted May 15, 2005 I don't know where I went wrong but... now I only get one entry per portal and it is independent of my empty field! Here is what I did. In child, created new field, cEmptyField with calc of if(IsEmpty(dateReturned), familyID, "") In parent, created relationship between parent/child with two fields link of parent:familyID to child:cEmptyField Then I switch the portal relationship to this newly created one. My main goal is to have 4 rows of portals where if a family has already checked out there quata of 4 items and not returned them back, then all 4 potal rows will be filled and the database user can not let them check any out. However, if they only checked out two unreturned items, the database user can then fill in the remaining 2 rows for new items to be checked out. Thanks for your patience!
MoonShadow Posted May 15, 2005 Posted May 15, 2005 This should work for you. Things to double check: 1) Make sure your portal is based upon the new relationship. 2) Check each portal field and make sure it matches this same new relationship. 3) cEmptyField should be a calculation (text) and make sure 'Do not store' is unchecked. It should be indexed because it's used in the relationship. 4) Make sure the fields are well within the portal - particularly don't let the field boundaries touch the left or top of the portal boundary. If those things don't work, you may need to post your file so we can identify the problem with it. I suspect #2. Did you remember to change your fields to this new relationship also?
missedplaced Posted May 19, 2005 Author Posted May 19, 2005 Thank you, thank you, thank you! I forgot number 2! But now I can't add any new records in my portal because my relationship is now invalid! I think this might be due to the relationship being based on a calculation field. Is there a work around for this? I know, I am nothing but trouble! A zillion thanks in advance!
MoonShadow Posted May 20, 2005 Posted May 20, 2005 "I think this might be due to the relationship being based on a calculation field." Calculations are used all the time in child-side of a relationship and work a sweet treat. But they can't be based upon a related field, a global or an aggregate function. AND, they can't be based upon an unstored calculation ... can't use Status() functions. 1) Re-verify point #3 above. Unstored must be unchecked in Storage Options and it should be a calculation and not a standard field or a global. 2) You probably just need to set the checkbox option to 'Allow Creation of Related' in your new parent:familyID to child:cEmptyField relationship. Allow creation on the Child side. No matter whether DateReturned is text or date (or even number), IsEmpty() will work so I doubt is a data-type mismatch. Last thing to try: Place cEmptyField and ReturnDate both on a table layout in your child file and take a look. Is it filling cEmptyField properly with the FamilyID?
missedplaced Posted May 24, 2005 Author Posted May 24, 2005 Upon review, I had a whole lot of things not working with my relationships. Thank you so much for taking the time to answer my questions!!!!
Recommended Posts
This topic is 7124 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