Announcement

Collapse
No announcement yet.

Calculated Fileds in grid not working

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculated Fileds in grid not working

    Good Morning

    I try to calculate the folllwoiung in a grid (placed this code in onRecord)

    Code:
    {event_density} = {reg_p} / {min_p}
    But it is not working , the grid is not displayed. Nothing is displayed.

    the type of event_density is percentage the two others are integer

    reg_p is a "manual field" and loaded from an other tabele

    Code:
    SELECT count(participant_id) FROM bpmspace_edums.participation
    WHERE  event_id = {event_id}  AND`status_participation_id` != 6
    ORDER BY participant_id
    min_p is also a "manual field"

    Code:
    SELECT min_participants 
    FROM course 
    WHERE course_id = {course_id} 
    ORDER BY min_participants
    do i have to use
    $sql = 'SELECT ...';
    sc_lookup(tbl_lookup,$sql);
    {calc_value} = tbl_lookup[0][0];

    Use onInit to get values before form fields are populated. Use onLoad if you need to access existing form field values.
    as explained here http://www.scriptcase.net/forum/show...culated-Fileds
    that would be double work since the sql statement is allready in the filed definition- and they are working

    thanks rob

  • #2
    Mhh probably it has nothing to do with the lookup
    when i place
    Code:
    {event_density} = 50 + 10
    in the onRecord evenet although nothing ist displayed

    Comment


    • #3
      It wouldn't be the case that you have to terminate your php lines with ';' would it?
      Albert Drent
      aducom software netherlands
      scriptcase partner, reseller, support and (turn-key) development
      www.scriptcase.eu / www.scriptcase.nl

      Comment


      • #4
        so simple so true !!!! thanks
        Note to myself SQL statements don't need ";" php skripts do :-)

        Comment

        Working...
        X