Community

Handling Recurring Document Sections in Verification Script

Good day,

I have 1 document definition that consists of 15 types of document sections and this sections can appear more than once each, how to call specific document sections field into verification script rules?

I can do it easily in export script but I cannot use the script on verification rules.

== Document.Sections.item(0).field("Myfield"),value

I have found way to handle this problem with workaround, but I dont think its the best way to handle this problem.


Was this article helpful?

0 out of 0 found this helpful

Comments

2 comments

  • Avatar
    Permanently deleted user
    Good day, I have 1 document definition that consists of 15 types of document sections and this sections can appear more than once each, how to call specific document sections field into verification script rules? I can do it easily in export script but I cannot use the script on verification rules. == Document.Sections.item(0).field("Myfield"),value I have found way to handle this problem with workaround, but I dont think its the best way to handle this problem.


    Hello,

    If you add the field of repeated section to the Rule Settings then it will appear IRuleContext.Fields collection.
    For example, you have sections X and Y. Y can be repeated for 3 times. From field Field_X of section X you want to access Field_Y in section Y.

    The access code will be the following (Context is IRuleContext object of Field_X it will be "this" in JScript):
    Field_Y(at 1st page of Y): Context.Fields[1].Items[0];
    Field_Y(at 2nd page of Y): Context.Fields[1].Items[1];
    Field_Y(at 3rd page of Y): Context.Fields[1].Items[2];
    0
  • Avatar
    Permanently deleted user


    Hi POG.

    Yes I already find solution yesterday for my project but thanks for your answer, its enlighten me about what Context means in rule script.


    0

Please sign in to leave a comment.