Jump to content

Conditional format on related record status


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

Recommended Posts

Hi guys, not sure how to do this.
These are my 3 tables
Student --<Enrollment >--- Course

I need a button on the students layout to turn green if the status field on the enrollment table ="Passed",
How can i do this? Keep in mind that a student has many enrollments
 

Link to comment
Share on other sites

24 minutes ago, muskee said:

Keep in mind that a student has many enrollments
 

That's the first thing that came to my mind. Which is why your requirement is not clear. Perhaps you want the button to turn green if any of  the related Enrollments is "Passed"? Or maybe you want it to turn green only when all the related Enrolments are "Passed"? Or maybe you want the button to be in a portal, so that each Enrollment would have its own button, colored according to its own status?

Link to comment
Share on other sites

So the student can course a max of 10 different subjects. So there should be 10 different buttons that represent each different course that student has being and each button should change color depending on the course status (passed, failed, expelled)

 

What I'm Planning is to replicate this
Progress%20Bar%20example.jpg

Each button is suppose to be a course.that changes color depending on course status

Hope that clears everything! thanks for your help!

Link to comment
Share on other sites

Oh I'm not using a portal, only want to replicate this progress bar but I can't seem to know how to use the conditional format depending on the related record status.
If I need to use a portal I can do that, If I don't need the portal  then there's no reason to use it.
Soo how can I get this done? >_<

Link to comment
Share on other sites

Using a portal has the advantage of only having one button to define. Even if you use multiple portals, the buttons can be defined uniformly -so you can duplicate the first portal and change nothing except the initial row number.

If the buttons are outside of a portal, you will need to use the GetNthRecord() function to get the value of the corresponding record in Enrollments. I am not sure what your buttons are supposed to do when pressed: that might be an additional complication.

 

Edited by comment
Link to comment
Share on other sites

So I put a button inside the portal, I don't need the button to do anything other than change color. It works, I'll have to make 10 portals cus I must filter by name so no other unwanted enrollment appears. Thanks alot!

I would like to make the progress calculation, i.e : 30% finished.  I'm thinking this has to be done in the enrollment table, right?
 

Thanks!

Link to comment
Share on other sites

26 minutes ago, muskee said:

I don't need the button to do anything other than change color. It works, I'll have to make 10 portals cus I must filter by name so no other unwanted enrollment appears.

I am afraid you have lost me at this point. If your buttons don't do anything, then why do they need to be buttons? And why does the portal have to be filtered? Doesn't the relationship already filter out all "unwanted enrollments"? In any case, the only reason to split the portal is to display the related records side-by-side.

 

26 minutes ago, muskee said:

I would like to make the progress calculation, i.e : 30% finished.  I'm thinking this has to be done in the enrollment table, right?

No, it would be in the Students table, and it would look something like =

ValueCount ( FilterValues ( List ( Enrollments::Status ) ; "Passed" ) ) / Count ( Enrollments::StudentID )

Note that this takes into account all enrollments related to the student. If your portal is filtered, the filter will be ignored.

 

 

Edited by comment
Link to comment
Share on other sites

8 minutes ago, comment said:

I am afraid you have lost me at this point. If your buttons don't do anything, then why do they need to be buttons? And why does the portal have to be filtered? Doesn't the relationship already filter out all "unwanted enrollments"? In any case, the only reason to split the portal is to display the related records side-by-side.

My bad, I´ll explain a little more:
Courses are categorized by math, science, laguage, etc.
A student can enroll in which ever. I want to track the progress of a student in all his math courses. For example math has 4 courses (calculus 1, 2 , 3 , geometry).

So if the student wins calculus 1, he would have completed 25% of all his math category.
Soo to show this I would filter the portal to show only his course of calculus 1, and turn green if passed. (I chose a button cus rectangle doesn't have conditional format).

Link to comment
Share on other sites

7 minutes ago, muskee said:

I want to track the progress of a student in all his math courses.

I see. The problem here is that portal filtering happens only at the layout level, and a calculation (that operates at the data level) cannot see it. One way to solve this would be to define another relationship that would only show enrollments in math courses. Another option would use summary field/s defined in the Enrollments table and place the result in a portal filtered the same way. Can the Status field show other values in addition to "Passed"?

Link to comment
Share on other sites

14 hours ago, comment said:

I see. The problem here is that portal filtering happens only at the layout level, and a calculation (that operates at the data level) cannot see it.. Can the Status field show other values in addition to "Passed"?

Wait, which problem are we talking about? Status can be passed, failed, expelled

Link to comment
Share on other sites

On 10/26/2016 at 3:56 PM, muskee said:

which problem are we talking about?

The problem of calculating the percentage of Passed.

 

On 10/26/2016 at 3:56 PM, muskee said:

Status can be passed, failed, expelled

Then it probably would be easier to define a new relationship.

Edited by comment
Link to comment
Share on other sites

1 minute ago, comment said:

Then it probably would be easier to define a new relationship.

Ok so I should make a new table occurrence? and what exactly am I doing with this new relationship?
I was thinking about doing a calculation in enrollments like this:
calcApproved= If (Status="Approved"  and PlanCarrera::Category="Math"; 1)
Then make a summary field that adds up calcApproved.
Then in the students layout make another field that takes the summary field and divides it by 4 ( 4 is the number of math courses)

Link to comment
Share on other sites

Well, then you cannot divide by hard-coded 4, can you? And what will you do for the other areas (language, arts, etc.) - will you define dedicated calculation/summary fields for each one of these?  

I am not sure what exactly you expect to achieve here. I suggest you take a look at the attached demo (grossly simplified) and see if something like that could work for you.

 

ProgressInCategory.fp7

Link to comment
Share on other sites

You are the man!
Thanks for everything, your solutions always surprise me, keep up the good work :)

PS: quick question, why did you declare Students::gCategory as global? I don't understand very well when to declare a variable as global

Link to comment
Share on other sites

The category the user chooses to view is not an attribute of any specific student. Global fields hold the same value for every record in the table. And every user has their own set of global values. Also important: modifying a global field does not modify the current record. This makes global fields suitable for controlling the user interface, while actual data is stored in regular fields.

Link to comment
Share on other sites

This topic is 2698 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.