Community

How to reach parent of IField in the script?

I'm writing a custom action. I have Context as input.

My fields structure:

TABLE:

  • ROW 1
    • FIELD1
    • FIELD2
    • ...
  • ROW 2
    • FIELD1
    • FIELD2
    • ...
  • ...

So, I have access to current field (for example FIELD1), but I want to have access to another field (FIELD2) in the same row.

How can I reach that field?

So, I need to get ROW1 from FIELD1. After that I can easily reach FIELD2 by name. I could not find it in documentation. Only selectors to children, not to parent.

Was this article helpful?

0 out of 0 found this helpful

Comments

3 comments

  • Avatar
    Permanently deleted user

    Hello,

    Please note that all the fields that are involved in scripts should be added to the "available fields" list and, if you want to change these fields, the "read-only" checkmark should be unselected. Fields insides scripts could be accessed by their full names or aliases. But when you are working with repeating groups or tables, to get access to all the rows/group instances by their number you should implement these scripts on higher level that the "Table"/"Repeating group" fields e.g. on the level of Document Section.

    For doing this the construction:

    Document.Field("the Table").Items[i].Field("the Column").Text, where i = row’s number

    can be used.

     

    Please inform us, if this logic is not option for you.

    0
  • Avatar
    Permanently deleted user

    Thanks, Ekaterina

    Document.Field("the Table").Items[i].Field("the Column").Text, where i = row’s number

    That is totally clear, if you know row id.

    What we want to implement: want to have Custom action on the FIELD1, by clicking this action FIELD2 suppose to be filled based on FIELD1 value.

    I can create custom action on FIELD1, but I can not reach FIELD2 in the same row. I need to know row id in your approach.

    Maybe somehow can I get current row id from my custom action?

     

    0
  • Avatar
    Permanently deleted user

    Hello,

    On the level of table cell (or element of repeating group) no information about row (instance) number and rows (instances) count is available. Row or instance number can be found and used only in scripts belonging to the higher level element that table row/group instance.

    0

Please sign in to leave a comment.