Announcement

Collapse
No announcement yet.

Editable Grid - Calculation

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

  • Editable Grid - Calculation

    Hello.

    I have a master form which uses a editable grid for the "Master/Detail Form".

    On the editable grid I want to do a basic calculation....

    There is a lookup that retrieves a field called "Bags per Case" from the master form table.

    Then in the Editable Grid I do the following formula...

    sc_lookup(dataset, "select orderID, SHIPPING_bags_per_case from tb_byob_orders where orderID='{orderID}'" );
    [result] = {dataset[0][1]};

    {VESSEL_cases_shipped} = {VESSEL_qty_shipped_planned} / [result];


    The SC_Lookup gets me the right value (10) but I can't get the formula in the editable grid to work and fill in the "Cases Shipped" field ?

    Whats wrong here?


    Master-Detail.jpg
    Last edited by instore; 10-28-2014, 01:39 PM.

  • #2
    Have you examined both the contents of all the variables before and after the calculation?

    Also, does [result] need to be a global variable? Have you tried it as just a local PHP variable?

    e.g.

    Code:
    $result = {dataset[0][1]};
    
    {VESSEL_cases_shipped} = {VESSEL_qty_shipped_planned} / $result;

    Comment


    • #3
      I saw similar example in http://www.scriptcase.net/watch-scri...video-courses/ in Nested Grids video or in other related to grid. You need to update fiield in Master Form when value will be changed in Detail form, right ?

      Comment

      Working...
      X