Jump to content

Don't quite get List function...


This topic is 3374 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)!!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

  • Like 2
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 3374 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.