cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

0 Kudos

Hello Gayathri,

thanks for your answer We used your approach and modified it to our requirement. The sortation works within the array and everything seems to be correct.

Nevertheless, the sortation will be not reflected in the extension collection. Furthermore, we got an error message after we add/remove values with our test user. It says that we don't have the rights to edit the master agreement.

I want to ask you how the sortation can be reflected in the extension collection? Which additional step we have to do?

Thanks in advance,
Heiko

Former Member
0 Kudos

Hi Heiko,

Good to know you were able to use the comparator! I have not sorted my custom collection "in place" my requirement was to populate another custom collection based on consolidating and sorting values from other collections.. but I believe you can sort in-place also if you are coding for the right scripting event.. like Validate or Pre phase change.. what is the Target of your script?

- Gayathri

0 Kudos

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

Answers (0)