Ask a Question

Grid:how to search and return for single row where two columns are compared from multiple records

msap
Frequent Contributor

Grid:how to search and return for single row where two columns are compared from multiple records

any suggestions

:In a Grid using Java script how to search and return return the row from Grid where two columns are compared from multiple records.

compare both columns to avoid duplicate value from one of the rows.

 

6 REPLIES 6
msap
Frequent Contributor

Columns= new Array ("param1","param2");
Values=new Array("SUB","TEST");
RowIndex = Grid2.FindRowByMultipleValues("Columns", "Values");

 

 not working as findrowbymultiplevalues method gives an error. FindRowByMultipleValues("Columns", "Values");object not found.

any ideas.

SaravanaKumar_N
Contributor

Could you try this...  RowIndex = Grid2.FindRowByMultipleValues(Columns, Values);

 

Double Quotes should be the issue here - [Grid2.FindRowByMultipleValues("Columns", "Values");]

msap
Frequent Contributor

 RowIndex = Grid2.FindRowByMultipleValues(Columns, Values);

i changed the 2nd lin too :

Values=new  Array(COUNTRY,asa); 

instead Values=new  Array("COUNTRY","asa"); 

i tried this , still gives an error Unable to find the object FindRowByMultipleValues(null, null). 

 

No, while declaring the variables, the values should be within the quotes...

 

Columns= new Array ("param1","param2");
Values=new Array("SUB","TEST");

 

But while finding, if you are using a variable name, avoid using the quotes...
RowIndex = Grid2.FindRowByMultipleValues(Columns, Values);

 

TestComplete manual has vast examples... the below is for Find method.

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/find-m...

 

You can also refer w3school for JavaScript help...

https://www.w3schools.com/js/js_arrays.asp

msap
Frequent Contributor

Thanks.. If I declare values in quotes, i get java run time error "sub" is not defined.

I went through find methods and used the find row method. it works good. but currently i need to search the records that matches more than one columns in a  a row.

So was using this method:FindRowByMultipleValues .

I will check in w3 schools. Thanks  alot for responding.

msap
Frequent Contributor

any other suggestions would be appreciated.

for searching row giving two or more than two column values.

cancel
Showing results for 
Search instead for 
Did you mean: