I was wondering whether it would be possible to set the main and additional parents of an item via auto-assignment. For example, if the Item field contains a certain string, then assign a certain other item as a Parent of that item.
Then I noticed that Pierre had suggested (already implemented?) the following functions:
- GetMainParentID(ItemID)
- SetMainParentID(ItemID) = NewMainParentID
- GetParentID(index)
- SetParentID(index) = NewParentID -- 0 = Delete Parent
- nbParents -- already exists
That certainly seems to suggest that we could set parents for an item.
But, I am wondering about a basic question about scripting in IQ. Is it possible to do things other than set the value of a field? Looking at the Field Properties dialog, and documentation section on the Equations ( http://www.sqlnotes.net/drupal5/index.php?q=node/3965 ), it seems that scripting is used only to set the values of fields via column equations, auto-assignments, etc. And from what I can tell, the main parents and other parents of an item are not fields that can be changed by the user; these relations can only be set by through the IQ UI. "ItemParent" appears in the field list, but it s a read-only field, and also it seems to refer to the "main parent", not a non-main parent.
So, even if we have the functions that Pierre describes above, such as "SetParentID", how would it be used? Would the function have to be called in a column equation or auto-assignment rule to set the value of another field?
I hope my question makes sense.
Comments
I mean to study that Book Review app so that I can begin to grasp some of IQ's capabilities better.