$decDocumentItem

Substracts the specified decimal value and the value of the named document item.
Syntax
    $decDocumentItem{document_item_name}{decimal_value}
    $decDocumentItem{document_item_name}
DocumentationSubstracts the specified decimal value and the value of the named document item:

    Parameters:
      document_item_name, the name of the document item whos value is to be decremented.
      decimal_value, an optional parameter that defaults to 1 and represents the decrementation amount of the document items value.
    Throws:
      an java.lang.IllegalArgumentException if the named document item does not exist.
      an java.lang.NumberFormatException if 'decimal_value' or the value of the named document item is not a numeric decimal value.
Examples
The following expression decrements the value of the document item named 'value'

    $if{$existsDocumentItem{value}}
      {
      $decDocumentItem{value}
      }
    and is equivalent to the expression

    $if{$existsDocumentItem{value}}
      {
      $setDocumentItem{value}{$add{$getDocumentItem{value}}{-1}}
      }
    or equivalent to the expression

    $if{$existsDocumentItem{value}}
      {
      $setDocumentItem{value}{$dec{$getDocumentItem{value}}}
      }
The following expression substracts the value of the document item named 'value' and the number 7

    $if{$existsDocumentItem{value}}
      {
      $decDocumentItem{value}{7}
      }
    and is equivalent to the expression

    $if{$existsDocumentItem{value}}
      {
      $setDocumentItem{value}{$add{$getDocumentItem{value}}{-7}}
      }
    or equivalent to the expression

    $if{$existsDocumentItem{value}}
      {
      $for{$set{counter}{0}}{$less{counter}{7}}{$incLocal{counter}}
        {
        $setDocumentItem{value}{$dec{$getDocumentItem{value}}}
        }
      }
GroupMath
Minimum required transaction-mode:UPDATE=TREE
Required scripting permission of the developerPERMISSION_FL_BASIC
Minimum parameters1
Maximum parameters 2