Announcement

Collapse
No announcement yet.

On record event - grid

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

  • On record event - grid

    On "on record event":
    $a = {quantity};
    {count_qty} += $a;

    This is my grid:
    id | art | quantity | carton_nr | count_qty
    1 |CS7520A000.10 | 720 | 92P14H7029 | 720
    2 |CS7520A000.10 | 12 | 92P15H3022 | 732
    3 |CS7520A025.10 | 120 | 92P14H7029 | 852
    4 |CS7520A025.10 | 57 | 92P15H3022 | 909
    5 |CS7520A050.10 | 120 | 92P14H7029 | 1029
    6 |CS7520A050.10 | 63 | 92P15H3022 | 1092

    I need to recalculate “count_qty” on change “art” name. In example: row (id 3) i have new art and "count_qty" have to start with 120 and not 852.
    Is possible?
    Thanks in advance

  • #2
    onScriptInit: [article] = '';

    onRecord:

    if({[article] !== {art})
    {
    {count_qty} = {quantity};
    [article] = {art};
    }
    else
    {
    {count_qty} += {quantity};
    }

    jsb

    Comment


    • #3
      Thanks jsbinca - it works.

      Comment

      Working...
      X