- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Select Associate Wizard SCRASSNEW
Mon 24 Feb 2020 - 8:22
In the wizard SCRASSNEW the first page contains a Searchlist control. This control has no text in its SearchListCode and I can't see anywhere in the script where this gets set. Ye wizard is run the searchlist that appears is SCHCONSEARCH with the filter FLTCONSEARCH. Also the Next button is not active until a an row is selected in the search list. I will be and modifying it slightly (manually controlling the Next button Enabled property with EnquiryForm.ActionNext.Enabled) and need to know how the searchlist controls it.
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Select Associate Wizard SCRASSNEW
Mon 24 Feb 2020 - 8:22
This wizard is a controlled by a code written into the core development so no scripting is involved
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Select Associate Wizard SCRASSNEW
Mon 24 Feb 2020 - 8:23
You can replicate the core code by hooking into the page changing and searchlist_searched events. With something like: FWBS.OMS.UI.Windows.ucSearchControl _search = null; http://enquiryForm.GetControl(“SearchList”) as FWBS.OMS.UI.Windows.ucSearchControl; FWBS.OMS.OMSFile file = null;
protected override void enquiryForm1_PageChanging(object sender, FWBS.OMS.UI.Windows.PageChangingEventArgs e)
{
if (_search.SearchList == null)
{
_search.SetSearchListType(FWBS.OMS.Session.CurrentSession.DefaultSystemSearchListGroups(FWBS.OMS.SystemSearchListGroups.ContactAssociate),file,null);
_search.SearchCompleted +=new SearchCompletedEventHandler(_search_SearchCompleted);
}
}
private void _search_SearchCompleted(object sender, SearchCompletedEventArgs e)
{
enquiryForm1.ActionNext = _search.SearchList.ResultCount > 0;
}
protected override void enquiryForm1_PageChanging(object sender, FWBS.OMS.UI.Windows.PageChangingEventArgs e)
{
if (_search.SearchList == null)
{
_search.SetSearchListType(FWBS.OMS.Session.CurrentSession.DefaultSystemSearchListGroups(FWBS.OMS.SystemSearchListGroups.ContactAssociate),file,null);
_search.SearchCompleted +=new SearchCompletedEventHandler(_search_SearchCompleted);
}
}
private void _search_SearchCompleted(object sender, SearchCompletedEventArgs e)
{
enquiryForm1.ActionNext = _search.SearchList.ResultCount > 0;
}
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Select Associate Wizard SCRASSNEW
Mon 24 Feb 2020 - 8:23
Thanks for that snippet, I've now almost customised the wizard as I want it.I have modified the dbRegInfo table so that my custom wizard opens instead of the core one.''UDSCRA guessing that when the CreateAssociate wizard is called like this FWBS.OMS.Associate newAssoc = FWBS.OMS.UI.Windows.Services.Wizards.CreateAssociate(fileID);the core
sets up the searchlist and everything else on the wizard.At the moment the UD wizard can be called in 2 places. From the Add Associate button on a matter which works fine, and f it's from the taskflow where I need further customisation. I need to call this wizard like below, so I can pass in an extra parameter FWBS.Common.KeyValueCollection _kvc = new
FWBS.Common.KeyValueCollection();_kvc.Add(“ForcedAssociate”, assocType);FWBS.OMS.UI.Windows.Services.Wizards.GetWizard(“udSCRASSNEW”,_file,FWBS.OMS.EnquiryEngine.EnquiryMode.Add,_kvc);All I do is check to see if the para does then the Wizard is being called through taskflow. Using the code you suggested I can get the searchlist to populate correctly.The problem I have is that code that gets the sel Associate.FWBS.OMS.Associate _ass = (FWBS.OMS.Associate)Enquiry.Object;I get and Object Reference Not Set error when trying to access any details related to the _ass obj as_ass.Contact.Approved == falseI've checked, and _ass is not null and _ass.ID = 0. Is there any other code I need/changes to the way I call the wizard to get this UD version to w one with the additional parameter of AssocType passed in via a KVC?
sets up the searchlist and everything else on the wizard.At the moment the UD wizard can be called in 2 places. From the Add Associate button on a matter which works fine, and f it's from the taskflow where I need further customisation. I need to call this wizard like below, so I can pass in an extra parameter FWBS.Common.KeyValueCollection _kvc = new
FWBS.Common.KeyValueCollection();_kvc.Add(“ForcedAssociate”, assocType);FWBS.OMS.UI.Windows.Services.Wizards.GetWizard(“udSCRASSNEW”,_file,FWBS.OMS.EnquiryEngine.EnquiryMode.Add,_kvc);All I do is check to see if the para does then the Wizard is being called through taskflow. Using the code you suggested I can get the searchlist to populate correctly.The problem I have is that code that gets the sel Associate.FWBS.OMS.Associate _ass = (FWBS.OMS.Associate)Enquiry.Object;I get and Object Reference Not Set error when trying to access any details related to the _ass obj as_ass.Contact.Approved == falseI've checked, and _ass is not null and _ass.ID = 0. Is there any other code I need/changes to the way I call the wizard to get this UD version to w one with the additional parameter of AssocType passed in via a KVC?
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Select Associate Wizard SCRASSNEW
Mon 24 Feb 2020 - 8:24
You can replicate the core code by hooking into the page changing and searchlist_searched events. With something like: FWBS.OMS.UI.Windows.ucSearchControl _search = null; http://enquiryForm.GetControl(“SearchList”) as FWBS.OMS.UI.Windows.ucSearchControl; FWBS.OMS.OMSFile file = null;
protected override void enquiryForm1_PageChanging(object sender, FWBS.OMS.UI.Windows.PageChangingEventArgs e)
{
if (_search.SearchList == null)
try
{
_contact = Contact.GetContact(Convert.ToInt64(_searchList.ReturnValues[“contid”].Value)); if (_contact != null)
_associate.SetAssociateInfo(_file, _contact, ““); //This links the contact to the associate
}
catch (Exception ex)
{
_contact = null; ErrorBox.Show(ex);
}
finally
{
}
}
protected override void enquiryForm1_PageChanging(object sender, FWBS.OMS.UI.Windows.PageChangingEventArgs e)
{
if (_search.SearchList == null)
try
{
_contact = Contact.GetContact(Convert.ToInt64(_searchList.ReturnValues[“contid”].Value)); if (_contact != null)
_associate.SetAssociateInfo(_file, _contact, ““); //This links the contact to the associate
}
catch (Exception ex)
{
_contact = null; ErrorBox.Show(ex);
}
finally
{
}
}
- Lynne Harding
- Posts : 335
Join date : 2018-12-20
Re: Select Associate Wizard SCRASSNEW
Mon 24 Feb 2020 - 8:24
Here is what my code currently looks like I declared these variables FWBS.OMS.UI.Windows.ucSearchControl _search = null; FWBS.OMS.OMSFile file = n FWBS.OMS.Contact _contact = null; FWBS.OMS.Associate assoc = null; Then on the Rendered event I've put the following. This includes the _searchList.ItemSelected += new EventHandler(this._search_ItemSelected);line, which caused errors when put in the initialised event of the form. file = FWBS.OMS.OMSFile.GetFile(Convert.ToInt32(Enquiry.ReplacementParameters[“FILEID”].Value.ToString()));_search = EnquiryForm.GetControl(“_search”) as FWBS.OMS.UI.Windows.ucSearchControl;if (_search.SearchList == null){_search.SetSearchListType(FWBS.OMS.Session.CurrentSession.DefaultSystemSearchListGroups(FWBS.OMS.SystemSearchListGroups.ContactAssociate),file,null);_searc
+=new SearchCompletedEventHandler(_search_SearchCompleted);_search.ItemSelected += new EventHandler(this._search_ItemSelected);}I have a message box in the
_search_SearchCompleted method and it works when a search is completed. I also have a message box in the _search_ItemSelected method but this does not fire at all, so the fo required to hook the contact up to the associate does not runprivate void _search_ItemSelected(object sender, System.EventArgs e){try{_contact = Contact.GetContact(Convert.ToInt64(_searchList.ReturnValues[“contid”].Value));if (_contact != null)_associate.SetAssociateInfo(_file, _contact, ““); //This links the contact to the as (Exception ex){_contact = null;ErrorBox.Show(ex);}finally{}}I've also noticed that this method never fires when I try it without this line._search.ItemSelected += new EventHandler(this._search_ItemSelected);Do you know why this method doesn't fire as it should?This code is in the scripting section of the Wizard and not the Searchlist.
+=new SearchCompletedEventHandler(_search_SearchCompleted);_search.ItemSelected += new EventHandler(this._search_ItemSelected);}I have a message box in the
_search_SearchCompleted method and it works when a search is completed. I also have a message box in the _search_ItemSelected method but this does not fire at all, so the fo required to hook the contact up to the associate does not runprivate void _search_ItemSelected(object sender, System.EventArgs e){try{_contact = Contact.GetContact(Convert.ToInt64(_searchList.ReturnValues[“contid”].Value));if (_contact != null)_associate.SetAssociateInfo(_file, _contact, ““); //This links the contact to the as (Exception ex){_contact = null;ErrorBox.Show(ex);}finally{}}I've also noticed that this method never fires when I try it without this line._search.ItemSelected += new EventHandler(this._search_ItemSelected);Do you know why this method doesn't fire as it should?This code is in the scripting section of the Wizard and not the Searchlist.
Permissions in this forum:
You cannot reply to topics in this forum
|
|