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

[Search Lists] Calling an internal action from Code Empty [Search Lists] Calling an internal action from Code

Fri 17 Apr 2020 - 15:38
Original Post: CDPLL 20/01/2015 17:28:30

"Hi, I want to call an internal action (EditWizard) on the click of a button in a search list but only within the code. I don't want it to run every time as it currently does as i have some checks in place where if certain criteria is not met then i want to stop the user going to the wizard. How is best to do this? Thanks Karl"

Responses:

Mike Vaughan (Thompsons) 20/01/2015 17:39:26
"Hi,

you can use the CommandButtonClick event of the searchlist and then call the wizard manually in the code. you'll need to change the ACTION on the button to None, and remove any reference to the wizard (via the button collection on the searchlist).

protected override void CommandButtonClick(object sender, FWBS.OMS.UI.Windows.SearchButtonEventArgs e)
{
//Row selected
if (SearchControl.SearchList.ResultCount>0)
{
switch (e.ButtonName.ToUpper())
{
case “CMDEDIT”:
//check criteria

FWBS.OMS.UI.Windows.Services.Wizards.GetWizard(“wizardName”, null, FWBS.OMS.EnquiryEngine.EnquiryMode.Edit, KVCParams);
}
}
}
"

CDPLL 21/01/2015 10:45:17
"Thanks Mike, I have tried this but i am now getting an error when trying to pass the parameter to the wizard error: The best overloaded method match for 'FWBS.OMS.UI.Windows.Services.Wizards.GetWizard(string, object, FWBS.OMS.EnquiryEngine.EnquiryMode, FWBS.Common.KeyValueCollection)' has some invalid arguments Line 40error: Argument ' cannot convert from 'string' to 'FWBS.Common.KeyValueCollection' Line 40 Any ideas?"

Mike Vaughan (Thompsons) 21/01/2015 11:01:04
"Hi Karl,
it might be that your last parameter isn't correct. If you have no KVC values to pass into the wizard, you can use a null. FWBS.OMS.UI.Windows.Services.Wizards.GetWizard(“wizardName”, null, FWBS.OMS.EnquiryEngine.EnquiryMode.Edit, null); If this doesn't work can you paste your code here?"

CDPLL 21/01/2015 11:18:45
" "

Mike Vaughan (Thompsons) 21/01/2015 11:32:19
"Hi Karl

in your parameter I think you can drop the @ sign from @FinLogID. FWBS.Common.KeyValueCollection keys = new FWBS.Common.KeyValueCollection(); keys.Add(“FinLogID”,Convert.ToInt64(sr[“finlogid”].Value));

Also, if you'll only have one item selected, you can access the selected row via SearchControl.CurrentItem[“finlogid”].Value;

Mike"

CDPLL 21/01/2015 11:36:27
"Awesome!! Thanks Mike that did it!!"
Back to top
Permissions in this forum:
You cannot reply to topics in this forum