0

Add to total in sub-table if choice is NO

Hello all I am trying to add to a value in a sub table on the results of a yes/no choice.. (triggered after update).... Sorry to ask such elementry questions here... I have looked thru the language reference here and other places and don't seem to be getting it...

if NOT 'Choice' then                  // if the yes/no choice equals NO
sum('Subtable'.value) + 1        // Then Add 1 to the to the total in the "value" column in the subtable "Subtable" 
else                                  
sum('Case Lots'.Uses)             // ELSE no change to the vaule in the subtable. 
end

 

Thanks again... 

2 replies

null
    • keone
    • 4 yrs ago
    • Reported - view

    I've managed to make some progress on this but it is concatenating my value... my subtable value is 1 and I add 1 I get 11 not 2...

    • Jorg
    • 4 yrs ago
    • Reported - view

    Hi, 

    Please check if the field 'Subtable'.value is a number field.

    If yes, your script should work (as long as the field 'Case Lots'.Uses is also a number field).

    If not, please try the following:

     

    if 'Choice' = 0 then                  
    number(sum('Subtable'.value)) + 1 
    else                                  
    number(sum('Case Lots'.Uses))   
    end

     

    Best, Jörg

Content aside

  • 4 yrs agoLast active
  • 2Replies
  • 1334Views