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
Admin
Admin
Posts : 122
Join date : 2018-12-17
https://mattersphere-devs.forumotion.com

Return Values From Search List Empty Return Values From Search List

Thu 23 Jan 2020 - 15:28
Hi,
We are calling a search list with the following code:
Code:

FWBS.Common.KeyValueCollection returns =
    FWBS.OMS.UI.Windows.Services.Searches.ShowSearch("GRPASSOCPICKER", new System.Drawing.Size(700,700),null, keys);

This search list allows users to select an associate. I would like to return the name of the associate the user has selected. How can I add a new key to the KeyValueCollection returned by the searchlist and set the value of the key to the name of the associate the user selected?I assume I use the "ItemSelected" event on the search list - what is the code to access the key collection that will be returned?
Thanks.
________________________________________________________________________________________________________________________________
Hi

The way to add a field to the Return Values in your search list is in the Search List Editor in the Admin Kit. Make sure you return the Associate Name in the Databuilder and then add it in to the Return Values.A code sample to return the AssocName
Code:

FWBS.Common.KeyValueCollection returns =
   FWBS.OMS.UI.Windows.Services.Searches.ShowSearch("GRPASSOCPICKER" ,new System.Drawing.Size(700,700),null, keys);

if (returns != null)
{
   FWBS.OMS.UI.Windows.MessageBox.ShowInformation(Convert.ToString(returns["assocName"]));
}
RegardsDanny
________________________________________________________________________________________________________________________________
So Simple!
Thank you!
________________________________________________________________________________________________________________________________
We aim to please,
________________________________________________________________________________________________________________________________
Hi,
How do we do this if the search list is a multi select list? The value of (Convert.ToString(returns["assocName"])) is now just the last one we have selected? Thanks,
Romie
________________________________________________________________________________________________________________________________
Hi
To use Multi Select you will need to Construct a Searches service object.Sample Below
Code:

FWBS.OMS.UI.Windows.Services.Searches sch = new FWBS.OMS.UI.Windows.Services.Searches("SCHCOMWEBFAVS");
sch.Size = new System.Drawing.Size(700,700);
FWBS.Common.KeyValueCollection[] returns = sch.ShowEx(null);
if (returns != null)
{
    foreach (FWBS.Common.KeyValueCollection ret in returns)
   {
       FWBS.OMS.UI.Windows.MessageBox.ShowInformation(Convert.ToString(ret["CDNOTES"]));
   }
}
You can then use a foreach to loop though the selected rows.
Regards

Danny
Back to top
Permissions in this forum:
You cannot reply to topics in this forum