This topic is locked
[SOLVED]

 Change text color or background of a field

10/11/2019 3:34:36 AM
PHPRunner General questions
Karlo_from_Germany author

Hello from rainy Germany, I need some inspiration again:
In my master table there is a field with the value "status" .

The master table has a detail table, in this table there is a field with the value "Detail-Status". The detail table can have any number of entries.
If all entries in the field "detail status" in the "detail table" have the value "completed", the value "status" in the master table should be marked in color (green). If the values in the detail table are different from "completed", this value should also be colored (red).
Alternatively, the field background could also be changed analogously to the specifications described above.
I have already tried to do this by using scripts in the "after record processed" area, but unfortunately I failed.

HJB 10/11/2019

https://xlinesoft.com/tutorials/ConditionalFormating.html (Needs FLASH to be activated in the browser to view...)

https://xlinesoft.com/phprunner/docs/conditional_formatting.htm
Liebe Gruesse in die Nordheide! Karlo, the term you are lookign for is named CONDITIONAL FORMATTING while

the above two URL's are just for inspiration purposes. Search this forum via matchword "conditional formatting" to

get more info on how other users had been approaching their demand. Stay tuned ..., HTH

Karlo_from_Germany author 10/12/2019



https://xlinesoft.com/tutorials/ConditionalFormating.html (Needs FLASH to be activated in the browser to view...)

https://xlinesoft.com/phprunner/docs/conditional_formatting.htm
Liebe Gruesse in die Nordheide! Karlo, the term you are lookign for is named CONDITIONAL FORMATTING while

the above two URL's are just for inspiration purposes. Search this forum via matchword "conditional formatting" to

get more info on how other users had been approaching their demand. Stay tuned ..., HTH


Thanks for your input. Of course I know the articles, they are very helpful and I have already implemented the ideas there.

But my problem is, that I have to do two steps, which are not described anywhere, at least I don't find anything.

Step 1: Determine whether all values in the field "detail-status" have the value "completed".

Step 2: If yes, then a certain field in the master table should have a certain background. If no, then the default setting should be used.

And this very special requirement is not described anywhere. The question is whether this is possible at all.

HJB 10/12/2019

I think, it is generally possible, yet it is most likely a mixture out of IF, THEN, ELSE functionality with OR logics.

Simply speaking: IF ((status field 1) OR (status field 2) OR (status field 3) OR (status field 4) OR

(status field 5)) ="incomplete" THEN (Master status field) = "incomplete" ELSE (Master Status field) = "complete".

To give the logics a finally wished "optical shape" too by means of BACKGROUND or FONT colors would need

of course turn out into additional manual hand coding to come on top. Three different approach ways to go: PHP, MySQL or JAVA scripting while

latter seems to be able to provide the most flexible solution under EVENT programming terms. Normally, given a support arrangement under

PHPRUNNER 10.3 is in place, the most simple way would to contact SUPPORT and to upload to DEMO account to let them see the structures and

field names etc pp, yet in your case, you aren't allowed to do so by your BOSS, hence only a freelancer, fit in JAVA for example, stuffed with

real field names out of your project and the logical steps to be done by the manual coding, seems to be able to help you out. As for me,

I can't be of service in that respect due to lacking JAVA programming knowledge base.

Admin 10/12/2019

Before assigning the color you need to loop through all details records and check the status of each. Based on that you can change background color.
Here is the pseudo-code for the SQL query that would retrieve all Order Details for the selected Order.

select * from OrderDetails where OrderID=<Current OrderID>


And here is the Database API function that can help you loop through SQL query results:

https://xlinesoft.com/phprunner/docs/db_query.htm