MikeKD Posted January 26, 2015 Posted January 26, 2015 Hi Folks, I've almost got the List function working, but can't quite jump a few hurdles. I have a cInstrument field on the Pupils table. The calculation is List (InstrumentLesson::Instrument;InstrumentLesson::AB Grade ) This only works for the first related record. e.g. Viola 5 Whereas: List (InstrumentLesson::Instrument ) lists all the related records. e.g. Viola Kazzoo Trombone What I'd actually like is something like: Viola 5 Kazoo 2 Trombone 4 Any ideas where I'm bodging this time please? Many thanks, Mike
bruceR Posted January 26, 2015 Posted January 26, 2015 You're not bodging anything. You are correct this time. List doesn't work the way you wish it would. List ( InstrumentLesson::Instrument) will get you one column. List( InstrumentLesson::AB Grade ) will get you the second column. IF there is an entry in every field, in both columns, then the list values will correspond to each other, and you will have to parse the two results to create what you want. 2
MikeKD Posted January 26, 2015 Author Posted January 26, 2015 Thanks Bruce; that does get all the information needed. But as you guessed, there isn't always info in the 2nd column, so it's not clear which info goes with what.. Am I able to use Case and text formatting functions in conjunction with List to try to format the resultant mess of data? Or do people just validate the Listed fields and add "No Data" or some such? Cheers! Mike
bruceR Posted January 26, 2015 Posted January 26, 2015 Sometimes people explain what they are trying to do. Since a portal does this handily - why isn't that the choice here? 1
MikeKD Posted January 26, 2015 Author Posted January 26, 2015 Sorry Bruce; here's the explanation! I use this field in a tooltip in a class layout. It has info like the pupils tutor group, attendance %, attainment %, baseline ability as well instruments learnt and standards. It used to be populated with info from 8 fields in the pupils table, but I recently changed to use related records in a portal to give more flexibility. Unfortunately, because the class register is a portal in the class layout, I can't put this info in a portal in a popup within that portal. I do have a portal that has instruments on another tab on the class layout, but the seconds it takes to change tab and select the right kid aren't something you have when a class is in front of you. It sounds like I might just have to put up with a list of the instruments each kid plays (or used to play)!!
bruceR Posted January 26, 2015 Posted January 26, 2015 Since you already have a workable solution to exactly this problem in another thread why are you not using it? Why did you start this thread? Also note there are getNthRecord solutions.
comment Posted January 27, 2015 Posted January 27, 2015 I use this field in a tooltip in a class layout. It is not easy to replicate a portal in a tooltip. Perhaps you should reconsider this need, as it doesn't sound like good user interface to have anyway. Otherwise you will need to either add a calculation field in the child table, concatenating the instrument name and the grade, and then list that, or use a custom recursive function to go over the related records one by one. Unfortunately, because the class register is a portal in the class layout, I can't put this info in a portal in a popup within that portal. Why don't you put this in a popup outside of the portal? If necessary, using an auxiliary relationship based on a global field? 2
MikeKD Posted January 27, 2015 Author Posted January 27, 2015 Since you already have a workable solution to exactly this problem in another thread why are you not using it? Why did you start this thread? Also note there are getNthRecord solutions. The solution in the other thread was based on having Instument1, Instrument2, Instrument3 and Instrument4, along with Grade1, etc fields in the pupil table. This was a problem for a couple of reasons: Some kids play more than 4 instruments. I could also do with more data about each instrument: status, started / stopped, teacher, exam marks etc. I'm happy for my colleague to add new records about instruments, but less so for them to alter fields in the Pupil table. As the solution in the other thread was based on different fields in the same table, it didn't solve the same problem as I had of listing different records. Also; I just wanted to learn more about using List - I couldn't find out much about it. Thanks both for your help though - I'm sorted now - got a c field in the instrument lesson table that concancates necessary data and list that into the pupil field which works fine in the tooltip. You are both right though - I will be looking at getting this info into a popup at a later stage - I'll then also be able to edit the data and make it look prettier!! Thanks so much :-) Mike
bruceR Posted January 27, 2015 Posted January 27, 2015 The solution in the other thread described how to do what Comment suggested; display a portal in a popup that might be triggered from a portal but is not actually attached to the portal. Thus avoiding the portal in portal problem. It is not dependent on having fields instrument1, instrument2, etc, which is of course not something anyone here would recommend.
MikeKD Posted January 27, 2015 Author Posted January 27, 2015 Sorry Bruce, I thought you were talking about a different thread. I reckon it should be possible to have a few portals in a popup, giving information on a selected student - almost doing the same job as a tooltip, but better :-) But at least I can now get rid of Instrument1-4 fields. So progress is being made... I'm very sorry if I've been frustrating in this thread; it's through stupidity, not desire. I'm really grateful for the support that folks like you and comment have given me. best wishes, Mike
Recommended Posts
This topic is 3645 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