Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Heather@FootAnstey
Posts : 57
Join date : 2018-12-19

Passing Parameter Values to a Search List Empty Passing Parameter Values to a Search List

Thu 16 Apr 2020 - 19:37
Original Post: Phil  04/05/2012 10:45:06

"Hi all,
Apologies if this is a noddy query, I'm quite new to Matter Centre.
I've created a search list to use in the command centre.
This search list has a data builder which runs a Stored Procedure called udReadLMSFile.
udReadLMSFiles takes a Parameter called @Directory which i set a TestValue to 'C:\temp\' and this returns data fine based on that value.
My problem is when I create a new tab on Command CentreI can add my SearchList in but cannot seem to find anywhere in the settings where I can bind a value to the
@Directory.
Is there such a setting somewhere or can I do it though code on my SearchList maybe using something like the Initialise() Method and then Set the Parameter Value
from Specific Data or something like that?
I've tired the second part but cannot seem to get the right area, i tried the last on usingthis.SearchList.ChangeParameters Method but i got random not very helpful
error messages when trying to save the SearchList.
Any help or points would be great.
Cheers Phil"

Response: Richard Annison 08/05/2012

"Hi Phil,
You could tackle this in a number of ways. If it is static then you could just add the value directly into the BoundValue.
Otherwise you can add a filter screen and set the value in one of the controls. The BoundValue then becomes %controlName%.
Or you can inject the value inside the searching event
protected override void Searching(object sender, System.ComponentModel.CancelEventArgs e)
{
//You should check the value doesn't already exist before adding
this.SearchList.ReplacementParameters.Add(“directory”,@”c:\temp”);
}
Regards
Richard"

Outcome: Phil 08/05/2012

"Hi Richard,
I've tried all 3 methods and they all work great.
Thanks for your help.
Phil"
Back to top
Permissions in this forum:
You cannot reply to topics in this forum