How to use optional field to sort or index?
Walkaway
Forums
Hi,
I wanted to use a drop down list to select some columns and these are not mandatory selection, for example there are five criteria's provided, if user selected all 5 criteria (tagged 5 column/fields) I want to use all five fields to sort/create index and perform direct extraction using that index, if user tagged only one column then I need to sort the field using only that criteria and so on...
I am not sure how to use "task.addkey" in these conditions. Can anyone please help me with the code.
Thanks in advance,
Vijay
Hi Vijay,
Hi Vijay,
I am not sure if I understand totally what you are looking for but maybe this example will help you out. So I am using an array called sFieldname() to hold the fieldnames for the user selected fields. I then perform an index before performing the extract. I loop through the array using a For ... next loop adding the contents to the task.AddKey function. I didn't check for blank entries so if you will have blank entries in the array then you should probably add a function to check such as if sFieldname(i) <> "" then.
I then do the same thing to the extraction so that it will use the index that was just created.
So hope this helps out some.
Brian