Skip to Content
avatar image
Former Member

CLM: Is it possible to use an extension collection as table with sortation?

Hello experts!

Currently, we use an extension collection as consecutively list. In our case each entry with cause will create a row with additional information about collaborator groups with read-write access in that table.

My questions are:

  1. ) Is it possible to use an extension collection as table which contains the dynamic component if user adds/removes row entries?
  2. ) If yes which approach can be done?

Best,

Heiko

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Mar 03, 2016 at 10:57 AM

    Hi Heiko,

    Didnt get your requirement.. but if you are looking to sort an extension collection based on the value of one of the columns then yes it can be done via scripting.

    We had a requirement where we added custom approvers to contract documents, there were custom columns like "Approver Sequence" in this extension collection and the final approvers list had to be sorted based on approver sequence. I wrote a comparator class like this in the relevant script (top of the script before actual script logic starts):

    //Comparator for sorting the custom approvers list

    class CustomListComparator implements Comparator {

        public int compare(Object o1, Object o2) {

            appSequence1 = o1.get("CUST_APP_SEQ").getDisplayName();

            appSeqInt1 = Integer.parseInt(appSequence1.trim());

            appSequence2 = o2.get("CUST_APP_SEQ").getDisplayName();

            appSeqInt2 = Integer.parseInt(appSequence2.trim());

            return appSeqInt1 - appSeqInt2;

        }

    }

    In the script, I copied the collection members to a java arraylist and passed it to this comparator to get back the sorted list like this:

              //Add the custom approvers to java ArrayList for sorting

                ArrayList customArrayList = new ArrayList();

                for (member:iter) {

                    //Do not add empty rows in the ArrayList

                    if (hasValue(member) @and hasValue(member.get("CUST_APPROVER")))

                        customArrayList.add(member);

                }

                Collections.sort(customArrayList, new CustomListComparator());

    Not sure if this was the best/cleanest solution but worked for us!

    - Gayathri

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Gayathri,

      I'm sorry for the late answer because I'm very busy. We choose Validate as target. Now it works.

      Thanks for your help 😊

      Best,
      Heiko