DataLink and other Scripts

Generic selectors
Exact matches only
Search title only
Search in content
Search in all posts
Search in pages
Answers
Questions
Solved2.51K viewsScripting
0

Can someone help me with the scripts for the following actions:

1. Run Datalink for a specific matrix using button controlled script
2. Script to delete all items of a category except the first
3. How to limit the number of items in a category to a certain number such as 100. That is when user presses enter, new items are created up to the limit set.
4. How to control the cursor to move to the right after pressing enter in a cell. By default the cursor moves to down but i know in Excel there is a setting to control its movement. How can this be done in Quantrix.
5. How to delete all empty rows or columns in a matrix with a script.

Thanks in advance

Selected answer as best
0

tawanda,

This is how you would delete the blank rows assuming that Category A of Matrix2 is in the Row position.
//DeleteNonBlankRecordInCategory
//By rlopez 10/15/2014

//Begin the For Each Loop
|Matrix2::A|.items.each
{
//String[] x = it.values
//System.out.println(x)
//Setup the Array
String[] arr = it.values
//Set Counter
counter =0
//Step through each element of the Array and evaluate if Null. If null then increase the counter.
for (int i = 0; i< arr.length; i ++)
if(arr[i]!=null)
counter++
//Where only null values where found in the arr of it.values delete that item
if(counter==0)
it.delete()
}

Selected answer as best
You are viewing 1 out of 5 answers, click here to view all answers.

Latest Questions