Adding ColumnName in SortBy in QuickSearch

Hello,

In Part Master Search, I want to add 1 more column in SortBy column. I want to add Description in SortBy. Since its a based search we cant do anything. But how to add in Quick Search this option.
I tried using BAQ for SortOption but there is nothing like parameter which will pass in BAQ for sort by.

Is there any way via Customization.
Thanks.

You can add an additional sort in the BPM for Part.GetList. It would be appended in the whereClause.

Hi Jason,

I checked in trace log but this method is not being called.
Can you let us know how to add this extra or new column into the default SortBy option of Part.
Thanks.

Is it Part.GetRows then? What is being called when you search?

Hi,

Yea its Get.Rows calling. This will work when we click on Search Button and based on parameter selected, it will display the result. But my query is before click on Search, I want to put value into SortBy Column of Part. Means when InvokeSearch method is called and search window popup, at that time, I want to add 1 new column in SortBy Column. Then i guess, automatically when search is called, this will work as per value selected in SortBy.

Why don’t you create a new Baq search?

Hi Christian,

Yes. BAQ can be created for any new quick search requirement. But this requirement is of parameter in quick search. When you wil open Part Search, 1st parameter is SortBy. In that I want to add 1 more new column like say Description. Thats it.
Then when search will click, search result will come as per sorting selected in above parameter.

This is only my query. :slight_smile:

Mmm I don’t think there is a eay to customize the search form via any type of customization. I thinl you have 2 options:

A) perform the sort on a bpm post-process on the getrows. This would be a hardcoded sort

B) replace the search button and add your own search form using a popup form by removing all controls (you can use UD01). This form will only be used to capture the search and sort options. After this, execute the getRows and compose the filter and sort expression.

BAQ Search does not have any filtering capabilities. It is very limited in how it can function.

Hi,

Is there any customization way to add extra column while InvokeSearch Adapter in SortBy option.

No, you have to replace the whole search form

Not directly.
How many records are you hoping to show when you filter?
If the column is shown, you can click on the header to sort it. If it isn’t shown, I use this code to add more columns:

//add to switch statement in BeforeAdapterMethod
		case "GetList":
		case "GetRows":
			System.Collections.ArrayList myCols = new System.Collections.ArrayList();
			EpiSearchColumn col1 = new EpiSearchColumn("Key1", "Alloy Code", -1, true, 0);
			EpiSearchColumn col2 = new EpiSearchColumn("Key2", "Common Tradename", -1, true, 0);
			EpiSearchColumn col3 = new EpiSearchColumn("Key3", "UNS", -1, true, 0);
				
			myCols.AddRange(new object[] { col1, col2, col3 });
			for (int i = 0; i < myCols.Count; i++)
			{
				oTrans_adapter.SearchForm.SetEpiSearchColumn((EpiSearchColumn)myCols[i], true);
			}
			break;

Where are you putting that code, Jason?

Where does this need to go?

Use the wizard to add the “BeforeAdapterMethod” code. Then add a switch statement inside it. Finally, use this code. Notice it is only for UD tables. You will need to change it for your table.

So I wouldn’t be able to use this method to add Customer Name and Contact Name to our Call Log search results?

Possibly, but the code won’t be the same. The fields are completely different and in your case it may not work for all searches.

OK. I’ll give it a shot. To confirm, this appends additional columns to whatever is already being returned?

Correct.

1 Like

Thanks, bud.