Select static and dynamic values for actions in invoice rules

Select static and dynamic values for actions in invoice rules

This is one of the steps required to configure actions for invoice rules in connection with the InvoiceRules plugin.

In selected actions (file operations, for example), combine multiple dynamic and static values to build the result. For example, a destination path for a "Copy file" action could be created by combining a static path like "\\myserver\somefolder\" with a dynamic value (the filename part of "Invoice image filename", for example)

The following options are available to configure how values are determined when actions are executed in connection with invoice rules when their conditions are met:

  • Current date/time - the current date is added using the date format specified here.
  • Current job name - the current job name is added.
  • Field value - the value from the selected field type on the current invoice is added.
  • Invoice GUID - the GUID for the invoice being processed is added.
  • Invoice image filename - the filename of the first image for the current invoice is added. You can choose to get the full path ("\\someserver\images\swe\1234.tif"), the filename only ("12345.tif"), the filename without the extension ("12345"), or just the file extension (".tif").
  • Invoice image file folder name - the folder name of the first image file for the current invoice. You can choose to get the full folder path ("\\someserver\images\swe"), the folder name only ("swe"), or a specific part of the folder structure (for example, the second part, "images").
  • Invoice transfer output filename - when this option is applied in any of the transfer events, it returns the filename of the current invoice output filename. You can choose to get the full path ("\\someserver\transfer\12345.xml"), just the filename ("12345.xml"), the filename without the extension ("12345"), or just the extension (".xml").
  • Numeric index from textfile - a numeric value is read from a text file and uses that value. After the value has been read, it updates the textfile with an updated value (+1) that is used next time.
  • Part of other value - returns a sub portion of another value. The following options are available:
    • Left position part - specify Start at to indicate which character to start with and Length to indicate how many characters to include. For example, if "abc1234xxxx" is a static value being considered, and Start at was specified as 3 and Length as 4, the characters used would be "c123".

    • Right part - specify Length to indicate how many characters are used from the end of the considered value. For example, if "abc1234xxxx" is a static value being considered, and 3 was the specified length, "xxx" would be used.

    • Split part - specify a character, such as a hyphen (-) for Split by to indicate how the considered value is split, and a number for Use part to indicate which part to use. For example, if "abc-1234-xxxx" is a value being considered, and 2 is specified as the part to use, the resulting part added would be "1234".

    • Input value - the other value from which the characters are extracted. The items available in the dropdown list include all of the other static and dynamic values

      described in this topic.
  • Static value (define/select) - the value written or selected here is added.
  • Textfile content - the entire content of the specified text file is read. If Discard reading errors is selected, and an error such as the file cannot be accessed occurs, nothing is added to the value defined by the action, and no record of it is kept in the invoice-rules logs. If the option is not selected, and an error occurs, it is logged in the invoice rules logs.
  • Userdefined variable - the value from the specified user-defined variable for the current invoice is added.
  • XML file value - specify the path to the XML file to use under Xml file path and the part of the file to use under Part of the xml file to use (Xpath syntax) . You can read more about XPath syntax here. If Discard reading errors is selected, and an error such as the file cannot be accessed occurs, nothing is added to the value defined by the action, and no record of it is kept in the invoice rules log. If the option is not selected, and an error occurs, it is logged in the invoice rules log.