Skip to main content
1-Visitor
January 8, 2013
Question

im createfield computation

  • January 8, 2013
  • 1 reply
  • 1669 views

Hi All,

We are trying to create a field using the command line function im createfield with a computed expression.

My command line failed with the message "error creating field parent or child: syntax error"

could you please tell me what's wrong with my following code :

im createfield --user=administrator --hostname=win-h9j0fcrdcqu --port=7001 --type=shorttext --computation='((aggregate("Forward Relationships",count() ) ) > 0) ? text("parent") : (((aggregate("Backward Relationships",count()) ) > 0) ? text("child") : text("orphan"))' --name='parent or child'

for your information,

going through the Integrity client admin GUI, I can create the "parent or child" field with the computation value : "((aggregate("Forward Relationships",count() ) ) > 0) ? text("parent") : (((aggregate("Backward Relationships",count()) ) > 0) ? text("child") : text("orphan"))"

Did I miss something?

Thanks a lot in advance for your help,

Jérôme

    1 reply

    1-Visitor
    January 9, 2013

    I think in the command line for creating a calculated field you also need to supply the --storeToHistoryFrequency=[never|daily|weekly|monthly|delta] and --[no]staticcomputation parameters.

    In the admin gui those values are probably set with the defaults.

    Also I noticed you are using "aggregate("Forward Relationships",count() ) ) > 0".

    Is there some advantage of this over using "RelCount("Forward Relationships") > 0" or "RelExists("Forward Relationships")" for the same functionality?

    Matt Giltaji

    1-Visitor
    January 11, 2013

    Hello Matt,

    Thanks a lot for your answer.

    I've inserted the storeToHistoryFrequency and staticcomputation parameter and change the expression to RelExists one and that works properly now.

    Thanks again,

    Jérôme