I have a Row equation which does not fire when I expect it to. I cannot even get it to execute with the key combination shift F9. Upon investigation, I suspect that the problem is not just with row equations but with the fact that the system fields itemParent and itemGParent are not being updated when an item is moved.
The formal documentation for row equations appears at: http://www.sqlnotes.net/drupal5/index.php?q=node/128.
There is a substantial discussion of when Row equations run at: http://www.sqlnotes.net/drupal5/index.php?q=node/2070. I hope that most of what is discussed there is already in the formal documentation, but I have not checked this.
If I create an item at one point in the hierarchy of an outline, and then move that item to another point in the hierarchy of the outline: I would expect a Row equation whose parameters include fields in the grid to be re-evaluated. This does not appear to happen.
The example I show occurs in the context of a simple taxonomy (classification tree). Thus item has TLI values of app (figure 1, point 1) and biz (point 2). The field Kind has a Row equation which uses the function constructPath, itself using the function ftrim (point 3).
For interest, but not essential to the main point of this post, here is the code of the functions ftrim and constructPath:
' This function is intended to strip off trailing tab characters
' sometimes left behind by Excel in a tab-delimited file
Dim outStr, lenOutStr, ix, currChar
outStr = Trim(InStr)
ix = len(outStr)
currChar = Mid(outStr, ix, 1)
While currChar = Chr(9)
ix = ix - 1
currChar = Mid(outStr, ix, 1)
outStr = Left(outStr, ix)
ftrim = outStr
Function constructPath(item, itemparent, itemgparent)
' This function creates a Windows-like hierarchical "path".
' Ideally, this function would be coded recursively, but I cannot find a way to make InfoQube return the parent of a given item in code.
' As coded, it only permits a three level hierarchy, grandparent, parent and item.
If itemparent = ""Then
fullPath = "\\" + ftrim(item) + "\\"
if itemgparent = ""Then
fullPath = "\\" + ftrim(itemparent) + "\\" + ftrim(item) + "\\"
' There is a grandparent:
fullPath = "\\" + ftrim(itemgparent) + "\\" + ftrim(itemparent) + "\\" + ftrim(item) + "\\"
constructPath = fullPath
The item air is at the wrong point in the classification, so I click and drag it such that it is under biz rather than app (figure 2 point 1).
Only if I press F5 refresh does item parent change; and still the Row equation is not executed. I select the Kind value \app\air\, press shift F9: no change.
The only way in which I can succeed in getting the Row equation to fire is explicitly to recalculate the whole field from the Field Properties pane ( figure 3 point 1):
This behaviour is consistent with the documentation if and only if the values for kind, which were initially created using the Row equation, are treated as though they had been explicitly entered by the user – which is not the case here.
Question one: is the behaviour described correct?
Question two: when and how are ItemParent and ItemGParent updated? Can this be influenced?
Question three: if the behaviour described above is correct, is there any simpler way of ensuring that the Row equation is executed when items are moved?
|Figure 1.png||197.19 KB|
|Figure 2.png||31.62 KB|
|Figure 3.png||11.47 KB|